VSCode, Intellisense C++ Autocomplete not working, ubuntu 20.04 - intellisense

I have installed Vscode under ubuntu 20.04. I cannot code without having intellisense autocomplete. But it is not working. I have used autocomplete in previous ubuntu LTS(16.04 , 18.04) with no problem.
I have configured c_cpp_properties.json.
{
"configurations": [
{
"name": "Linux",
"browse": {
"path": [
"/usr/include",
"/usr/include/x86_64-linux-gnu/qt5",
"/usr/include/pcl",
"/usr/include",
"/usr/lib",
"/usr/share"
],
"limitSymbolsToIncludedHeaders": true
},
"includePath": [
"/home/atas/colcon_ws/src/ROS_CB/chiconybot_ui/include/",
"/home/atas/colcon_ws/build/chiconybot_ui/",
"/usr/include/opencv4/",
"/opt/ros/foxy/include/",
"/usr/include/",
"/usr/include/x86_64-linux-gnu/qt5/"
],
"defines": [],
"compilerPath": "/usr/bin/gcc",
"cStandard": "c11",
"cppStandard": "c++17",
"intelliSenseMode": "clang-x64"
}
],
"version": 4
}
The header files are found correctly. I also installed all necessary extensions from VSCode marketplace.
I followed steps for configuring settings.json herelink
Finally, my settings.json looks like;
{
"files.associations": {
"cctype": "cpp",
"cmath": "cpp",
"csignal": "cpp",
"cstdarg": "cpp",
"cstddef": "cpp",
"cstdio": "cpp",
"cstdlib": "cpp",
"cstring": "cpp",
"ctime": "cpp",
"cwchar": "cpp",
"cwctype": "cpp",
"atomic": "cpp",
"strstream": "cpp",
"chrono": "cpp",
"cstdint": "cpp",
"initializer_list": "cpp",
"iosfwd": "cpp",
"mutex": "cpp",
"ratio": "cpp",
"system_error": "cpp",
"thread": "cpp",
"cinttypes": "cpp",
"typeindex": "cpp",
"deque": "cpp",
"vector": "cpp",
"array": "cpp",
"*.tcc": "cpp",
"bitset": "cpp",
"clocale": "cpp",
"complex": "cpp",
"condition_variable": "cpp",
"list": "cpp",
"unordered_map": "cpp",
"exception": "cpp",
"fstream": "cpp",
"functional": "cpp",
"iomanip": "cpp",
"iostream": "cpp",
"istream": "cpp",
"limits": "cpp",
"memory": "cpp",
"new": "cpp",
"ostream": "cpp",
"numeric": "cpp",
"sstream": "cpp",
"stdexcept": "cpp",
"streambuf": "cpp",
"type_traits": "cpp",
"tuple": "cpp",
"typeinfo": "cpp",
"utility": "cpp",
"valarray": "cpp",
"*.ipp": "cpp",
"codecvt": "cpp",
"future": "cpp",
"hash_map": "cpp",
"hash_set": "cpp",
"core": "cpp",
"dense": "cpp",
"numericaldiff": "cpp",
"unordered_set": "cpp",
"algorithm": "cpp",
"cfenv": "cpp",
"random": "cpp",
"optional": "cpp",
"string_view": "cpp",
"iterator": "cpp",
"map": "cpp",
"memory_resource": "cpp",
"set": "cpp",
"string": "cpp",
"slist": "cpp",
"shared_mutex": "cpp",
"forward_list": "cpp",
"qvboxlayout": "cpp",
"qstringlist": "cpp",
"qspinbox": "cpp",
"qstatusbar": "cpp",
"qpushbutton": "cpp",
"qcombobox": "cpp",
"qgraphicsopacityeffect": "cpp",
"qmovie": "cpp",
"qtimer": "cpp",
"qpainter": "cpp",
"qwidget": "cpp",
"qtwidgets": "cpp",
"regex": "cpp",
"qhostaddress": "cpp",
"qaction": "cpp",
"qlayout": "cpp",
"qframe": "cpp",
"qlayoutitem": "cpp",
"qsize": "cpp",
"qset": "cpp"
},
"editor.formatOnSave": true,
"python.pythonPath": "/usr/bin/python3",
"git.ignoreLimitWarning": true,
// Controls if quick suggestions should show up while typing
"editor.quickSuggestions": {
"other": true,
"comments": false,
"strings": false
},
// Controls whether suggestions should be accepted on commit characters. For example, in JavaScript, the semi-colon (`;`) can be a commit character that accepts a suggestion and types that character.
"editor.acceptSuggestionOnCommitCharacter": true,
// Controls if suggestions should be accepted on 'Enter' - in addition to 'Tab'. Helps to avoid ambiguity between inserting new lines or accepting suggestions. The value 'smart' means only accept a suggestion with Enter when it makes a textual change
"editor.acceptSuggestionOnEnter": "on",
// Controls the delay in ms after which quick suggestions will show up.
"editor.quickSuggestionsDelay": 10,
// Controls if suggestions should automatically show up when typing trigger characters
"editor.suggestOnTriggerCharacters": true,
// Controls if pressing tab inserts the best suggestion and if tab cycles through other suggestions
"editor.tabCompletion": "on",
// Controls whether sorting favours words that appear close to the cursor
"editor.suggest.localityBonus": true,
// Controls how suggestions are pre-selected when showing the suggest list
"editor.suggestSelection": "recentlyUsed",
// Enable word based suggestions
"editor.wordBasedSuggestions": true,
// Enable parameter hints
"editor.parameterHints.enabled": true,
"cmake.configureOnOpen": false,
}
I cannot think of a reason why the autocomplete wont work now. Please see whether you spot a mistake. Let me know in comments if more information is needed.
Thank you

Turns out that some problem related to VSCode itself. I checked for the new updates on help -> Check for Updates , after a new update things get back to normal. The current version that works is ;

Related

RabbitMQ Quorom Queue on Cluster - Replication not working

I have a 3 node rabbitmq cluster.
I have created some queues on it with the below definition:
{
"name":"ml-rec-changed-q",
"vhost": "some-vhost",
"durable":true,
"auto_delete":false,
"arguments":{
"x-queue-type":"quorum",
"x-quorum-initial-group-size":3
}
}
When i view the queue details on the management console I do not see the leader, online and members section of the queue details reflect the cluster nodes.
Please see attached screenshot
Ass seen in the screenshot, the members, leader and Online all show only 1 node which is rabbitmq-ha-server-2
There are other nodes in the cluster - rabbitmq-ha-server-1 and rabbitmq-ha-server-0
This cluster is set up in k8s using the rmq helm chart. The definitions json file is added as a volumne mount from a configmap.
Below is the configuration file:
{
"rabbit_version": "3.8.22",
"rabbitmq_version": "3.8.22",
"product_name": "RabbitMQ",
"product_version": "3.8.22",
"users": [
{
"name": "some-vhost",
"password": "some-vhost",
"tags": "",
"limits": {}
},
{
"name": "rmqadmin",
"password": "rmqadmin",
"tags": "administrator",
"limits": {}
}
],
"vhosts": [
{
"name": "/"
},
{
"name": "some-vhost"
}
],
"permissions": [
{
"user": "some-vhost",
"vhost": "some-vhost",
"configure": ".*",
"write": ".*",
"read": ".*"
},
{
"user": "rmqadmin",
"vhost": "some-vhost",
"configure": ".*",
"write": ".*",
"read": ".*"
},
{
"user": "rmqadmin",
"vhost": "/",
"configure": ".*",
"write": ".*",
"read": ".*"
}
],
"topic_permissions": [
{
"user": "some-vhost",
"vhost": "some-vhost",
"exchange": "",
"write": ".*",
"read": ".*"
},
{
"user": "rmqadmin",
"vhost": "some-vhost",
"exchange": "",
"write": ".*",
"read": ".*"
}
],
"parameters":[
{
"value":{
"max-connections":100,
"max-queues":15
},
"vhost":"some-vhost",
"component":"vhost-limits",
"name":"limits"
}
],
"policies":[
{
"vhost":"some-vhost",
"name":"Queue-Policy",
"pattern":"ml-*",
"apply-to":"queues",
"definition":{
"delivery-limit":3
},
"priority":0
}
],
"queues":[
{
"name":"ml-rec-changed-q",
"vhost": "some-vhost",
"durable":true,
"auto_delete":false,
"arguments":{
"x-queue-type":"quorum",
"x-quorum-initial-group-size":3
}
}
],
"exchanges":[
{
"name":"retry.exchange",
"vhost": "some-vhost",
"type":"topic",
"durable":true,
"auto_delete":false,
"internal":false,
"arguments":{
}
},
{
"name":"records-changed.topic",
"vhost": "some-vhost",
"type":"topic",
"durable":true,
"auto_delete":false,
"internal":false,
"arguments":{
}
}
],
"bindings":[
{
"source":"records-changed.topic",
"vhost": "some-vhost",
"destination":"cia-gis-ml-rec-changed-q",
"destination_type":"queue",
"routing_key":"#.record-changed.#",
"arguments":{
}
},
{
"source":"retry.exchange",
"vhost": "some-vhost",
"destination":"cia-gis-ml-rec-changed-q",
"destination_type":"queue",
"routing_key":"record-changed",
"arguments":{
}
}
]
}

VSCODE - How to configure docker compose problem matcher

I've the following workspace configuration
{
"folders": [
{
"path": "."
}
],
"launch": {
"configurations": [
{
"type": "chrome",
"request": "launch",
"name": "docker-compose:launch:chrome",
"url": "http://localhost:8080",
"webRoot": "${workspaceFolder}",
"sourceMaps": true,
"sourceMapPathOverrides": {
"webpack:///src/*": "${webRoot}/*"
},
"preLaunchTask": "docker:compose:up",
"postDebugTask": "docker:compose:down"
},
],
},
"tasks": {
"version": "2.0.0",
"tasks": [
{
"label": "npm:install",
"type": "shell",
"command": "npm install",
"linux": {
"command": "if [ -d ${workspaceFolder}/node_modules ]; then npm install fi"
},
"windows": {
"command": "cmd",
"args": ["/C","if not exist ${workspaceFolder}/node_modules npm install"]
},
"options": {"cwd":"${workspaceFolder}"}
},
{
"type": "docker-compose",
"label": "docker:compose:up",
"dependsOn": ["npm:install"],
"isBackground": true,
"dockerCompose": {
"up": {
"detached": true,
"build": true,
"customOptions": "",
"services": [
"site"
]
},
"files": [
"${workspaceFolder}/docker-compose.yaml"
]
}
},
{
"type": "docker-compose",
"label": "docker:compose:down",
"dockerCompose": {
"down": {
"removeVolumes":false
},
"files": [
"${workspaceFolder}/docker-compose.yaml"
]
},
},
]
},
"settings": {
"terminal.integrated.cwd": "${workspaceFolder}"
}
}
The launch("docker-compose:launch:chrome") configuration is not launching the chrome and I think thats happening because it thinks the task is not finished.
As far I know this should be checked using the problemMatcher, for vuejs as an example i can have the following problemMatcher:
"problemMatcher": [{
"base": "$tsc-watch",
"background": {
"activeOnStart": true,
"beginsPattern": "Starting development server",
"endsPattern": "Compiled successfully"
}
}],
How can i achive the same results using docker-compose?
I mean, is there a way to only launch chrome browser when the npm run serve command is finished?

Migrate vue chrome extension from manifest 2 to 3

How are you? I'm trying to migrate the version of extension from 2 to 3. For now, I want to get the result of build with version 3 so that I can upload it to the store. This is main reason why I'm migrating the extension.
It would be greatly appreciated if anyone give detailed solutions to be matched with my project? Looking forward to hearing from you.
This is origin manifest file. If you need more detail, I will provide.
{
"manifest_version": 2,
"version": "0.9.9",
"name": "AAAAAA",
"description": "BBBBBB",
"homepage_url": "https://AAA.co",
"permissions": [
"notifications",
"storage",
"activeTab",
"unlimitedStorage"
],
"icons": {
"16": "icons/icon.png",
"48": "icons/icon.png",
"128": "icons/icon.png",
"256": "icons/icon.png",
"512": "icons/icon.png",
"1024": "icons/icon.png"
},
"background": {
"scripts": [
"js/background.js"
],
"persistent": true
},
"content_scripts": [
{
"matches": [
"file://*/*",
"http://*/*",
"https://*/*"
],
"js": [
"js/content-script.js"
],
"run_at": "document_start",
"all_frames": false
}
],
"browser_action": {
"default_popup": "popup.html",
"default_icon": {
"16": "icons/icon.png",
"48": "icons/icon.png",
"128": "icons/icon.png",
"256": "icons/icon.png",
"512": "icons/icon.png",
"1024": "icons/icon.png"
}
},
"content_security_policy": "script-src 'self' 'unsafe-eval' https://cdn.segment.com 'sha256-ZgDy59Dh4jH9g/vcPYFpoQ1wumB4IdPEOS1BJc08i+Y='; object-src 'self';"
}

Vue + jest debug

i'm trying to debug in vs code my vue project which uses jest for testing.
jest.config.js:
module.exports = {
moduleFileExtensions: [
'js',
'jsx',
'json',
'vue'
],
transform: {
'^.+\\.vue$': 'vue-jest',
'.+\\.(css|styl|less|sass|scss|svg|png|jpg|ttf|woff|woff2)$': 'jest-transform-stub',
'^.+\\.jsx?$': 'babel-jest'
},
transformIgnorePatterns: [
'/node_modules/',
'/node_modules/(?!#babel)'
],
moduleNameMapper: {
'^#/(.*)$': '<rootDir>/src/$1'
},
snapshotSerializers: [
'jest-serializer-vue'
],
testMatch: [
'**/tests/unit/**/*.spec.(js|jsx|ts|tsx)|**/__tests__/*.(js|jsx|ts|tsx)'
],
testURL: 'http://localhost/',
watchPlugins: [
'jest-watch-typeahead/filename',
'jest-watch-typeahead/testname'
]
}
launch.json :
{
"version": "0.2.0",
"configurations": [
{
"type": "node",
"request": "launch",
"name": "Debug Unit Tests",
"runtimeExecutable": "npm",
"runtimeArgs": [
"run-script",
"test:debug",
"${file}"
],
"port": 9229
}
]
}
I've tried almost every tutorial online like :
https://medium.com/#sarngru/debug-vuejs-jest-tests-in-vscode-63e2ed45e503
when tried to run debugging got :
node_modules\.bin\vue-cli-service:2
basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")
^^^^^^^
SyntaxError: missing ) after argument list
at new Script (vm.js:83:7)
at createScript (vm.js:267:10)
at Object.runInThisContext (vm.js:319:10)
at Module._compile (internal/modules/cjs/loader.js:684:28)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:732:10)
at Module.load (internal/modules/cjs/loader.js:620:32)
at tryModuleLoad (internal/modules/cjs/loader.js:560:12)
at Function.Module._load (internal/modules/cjs/loader.js:552:3)
at Function.Module.runMain (internal/modules/cjs/loader.js:774:12)
at executeUserCode (internal/bootstrap/node.js:342:17)
Waiting for the debugger to disconnect...
tried npm install -g #vue/cli-service-global but it doesnt work as well.. plese help! thanks!
This works for me
launch.json :
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"type": "node",
"request": "launch",
"name": "Jest",
"program": "${workspaceRoot}/node_modules/jest/bin/jest.js",
"args": ["-i"],
"skipFiles": ["<node_internals>/**/*.js", "node_modules"]
}
]
}

Aurelia build for production creates bundles with "undefined" as content

Hi I have a web app built over the Aurelia CLI. To fix a performance problem (that I addressed here) I updated to the latest version of Aurelia (0.30.1, which fixed the performance issue). To do so, I had to update other npm packages, forcing the semver to the latest versions available using the npm-check-updates package first
npm install -g npm-check-updates
ncu --upgrade
npm update
npm install babel-runtime --save-dev
npm install timers-ext --save-dev
npm install gulp-sourcemaps --save-dev
npm install aurelia-pal --save-dev
npm install aurelia-binding --save-dev
npm install aurelia-templating --save-dev
this is my aurelia.json file
{
"name": "XX.YY.Web",
"type": "project:application",
"platform": {
"id": "web",
"displayName": "Web",
"output": "scripts",
"index": "index.html"
},
"transpiler": {
"id": "babel",
"displayName": "Babel",
"fileExtension": ".js",
"options": {
"plugins": [
"transform-es2015-modules-amd"
]
},
"source": "src\\**\\*.js"
},
"markupProcessor": {
"id": "none",
"displayName": "None",
"fileExtension": ".html",
"source": "src\\**\\*.html"
},
"cssProcessor": {
"id": "none",
"displayName": "None",
"fileExtension": ".css",
"source": "src\\**\\*.css"
},
"editor": {
"id": "vscode",
"displayName": "Visual Studio Code"
},
"unitTestRunner": {
"id": "karma",
"displayName": "Karma",
"source": "test\\unit\\**\\*.js"
},
"paths": {
"root": "src"
},
"testFramework": {
"id": "jasmine",
"displayName": "Jasmine"
},
"build": {
"targets": [
{
"id": "web",
"displayName": "Web",
"output": "scripts",
"index": "scripts/index.html",
"useAbsolutePath": true
}
],
"loader": {
"type": "require",
"configTarget": "vendor-bundle.js",
"includeBundleMetadataInConfig": "auto",
"config": {
"waitSeconds": 0,
"paths": {
"jquery": "../scripts/lib/cdn/jquery-3.1.0.min",
"breeze-client": "../node_modules/breeze-client/breeze.debug"
}
},
"plugins": [
{
"name": "text",
"extensions": [
".html",
".css"
],
"stub": true
}
]
},
"options": {
"minify": "stage & prod",
"sourcemaps": "dev & stage",
"rev": "stage & prod"
},
"bundles": [
{
"name": "app-bundle.js",
"source": [
"[**/*.js]",
"**/*.{css,html}"
]
},
{
"name": "vendor-bundle.js",
"prepend": [
"node_modules/bluebird/js/browser/bluebird.core.js",
"scripts/lib/require.js"
],
"dependencies": [
"aurelia-binding",
"aurelia-bootstrapper",
"aurelia-dependency-injection",
"aurelia-event-aggregator",
"aurelia-fetch-client",
"aurelia-framework",
"aurelia-history",
"aurelia-history-browser",
"aurelia-loader",
"aurelia-loader-default",
"aurelia-logging",
"aurelia-logging-console",
"aurelia-metadata",
"aurelia-pal",
"aurelia-pal-browser",
"aurelia-path",
"aurelia-polyfills",
"aurelia-route-recognizer",
"aurelia-router",
"aurelia-task-queue",
"aurelia-templating",
"aurelia-templating-binding",
{
"name": "text",
"path": "../scripts/lib/text",
"packageRoot": "../scripts/lib"
},
{
"name": "aurelia-templating-resources",
"path": "../node_modules/aurelia-templating-resources/dist/amd",
"main": "aurelia-templating-resources"
},
{
"name": "aurelia-templating-router",
"path": "../node_modules/aurelia-templating-router/dist/amd",
"main": "aurelia-templating-router"
},
{
"name": "aurelia-breeze",
"path": "../node_modules/aurelia-breeze/dist/amd",
"main": "aurelia-breeze"
},
{
"name": "breeze-client",
"path": "../node_modules/breeze-client",
"main": "breeze.debug"
},
{
"name": "whatwg-fetch",
"path": "../node_modules/whatwg-fetch",
"main": "fetch"
},
{
"name": "aurelia-testing",
"path": "../node_modules/aurelia-testing/dist/amd",
"main": "aurelia-testing",
"env": "dev"
},
{
"name": "icheck",
"path": "../node_modules/icheck",
"main": "icheck.min"
},
{
"name": "filesaver.js",
"path": "../node_modules/filesaver.js",
"main": "FileSaver.min"
}
]
}
]
}
}
I have now a problem. If I run
au build
or
au run –watch
I have no problem.
If I run
au build –env prod
to create the app- and vendor-bundle-[identifier].js, I don’t get any errors, but both files end up created empty, or rather just with “undefined” in them.
Node.js version: 6.11.2 (current latest stable)
NPM version: 3.10.10
Does anyone have an idea? Does it have to do with the minification mechanism (which in dev does not happen)
How can I debug / log what is going wrong?
UPDATE:
I have activated minifying also for the dev environment in the aurelia.json file, this is what I got
Failed to write the bundle
SyntaxError: Unexpected token u in JSON at position 0
at Object.parse (native)
at new Converter (E:\Code\Application\XX-dev\XX.YY.Web\node_modules\aurelia-cli\lib\build\convert-source-map\index.js:42:48)
at Object.exports.fromJSON (E:\Code\Application\XX-dev\XX.YY.Web\node_modules\aurelia-cli\lib\build\convert-source-map\index.js:96:10)
at work.then (E:\Code\Application\XX-dev\XX.YY.Web\node_modules\aurelia-cli\lib\build\bundle.js:259:48)
at process._tickDomainCallback (internal/process/next_tick.js:135:7)
{ uid: 8,
name: 'writeBundles',
branch: false,
error:
SyntaxError: Unexpected token u in JSON at position 0
at Object.parse (native)
at new Converter (E:\Code\Application\XX-dev\XX.YY.Web\node_modules\aurelia-cli\lib\build\convert-source-map\index.js:42:48)
at Object.exports.fromJSON (E:\Code\Application\XX-dev\XX.YY.Web\node_modules\aurelia-cli\lib\build\convert-source-map\index.js:96:10)
at work.then (E:\Code\Application\XX-dev\XX.YY.Web\node_modules\aurelia-cli\lib\build\bundle.js:259:48)
at process._tickDomainCallback (internal/process/next_tick.js:135:7),
duration: [ 5, 639721541 ],
time: 1502969144275 }
{ uid: 0,
name: '<series>',
branch: true,
error:
SyntaxError: Unexpected token u in JSON at position 0
at Object.parse (native)
at new Converter (E:\Code\Application\XX-dev\XX.YY.Web\node_modules\aurelia-cli\lib\build\convert-source-map\index.js:42:48)
at Object.exports.fromJSON (E:\Code\Application\XX-dev\XX.YY.Web\node_modules\aurelia-cli\lib\build\convert-source-map\index.js:96:10)
at work.then (E:\Code\Application\XX-dev\XX.YY.Web\node_modules\aurelia-cli\lib\build\bundle.js:259:48)
at process._tickDomainCallback (internal/process/next_tick.js:135:7),
duration: [ 47, 444524559 ],
time: 1502969144277 }
SyntaxError: Unexpected token u in JSON at position 0
at Object.parse (native)
at new Converter (E:\Code\Application\XX-dev\XX.YY.Web\node_modules\aurelia-cli\lib\build\convert-source-map\index.js:42:48)
at Object.exports.fromJSON (E:\Code\Application\XX-dev\XX.YY.Web\node_modules\aurelia-cli\lib\build\convert-source-map\index.js:96:10)
at work.then (E:\Code\Application\XX-dev\XX.YY.Web\node_modules\aurelia-cli\lib\build\bundle.js:259:48)
at process._tickDomainCallback (internal/process/next_tick.js:135:7)
If I activate minification for dev, it doesn't work either, giving the error I pasted above. If I also remove sourcemaps, it doesn't work (undefined by both bundles) but no error message.
Upgrading to the latest version of the aurelia-cli npm module (0.31.3) and all other modules to their latest versions fixed the issue.
I think you can now just do au build (without the --env prod flags.