what is clangd and why does it mark my avr code? - clangd

For the code completion I want to use clangd.
I think it is a "server" that provides code completion.
Clangd doesn't find links to the libraries in my avr-gcc code.
There are some descriptions:
https://clangd.llvm.org/troubleshooting#cant-find-includes-within-your-project
But I dont understand what would be appropriate in my case...
Has it something to do with compile_commands.json? config.yaml, .clangd?
clangd
Thank you

Related

VS Code's Intellisense for C++ not working

I am having problems getting VS Code’s Intellisense for C++ to work.
I am using Windows 10, g++ and gdb. I have installed the extensions C/C++ for Visual Studio Code and the C/C++ Extension Pack.
If I write msg, for example, main, mitl, module and mutable will appear, but that’s it - essentially, I get a partial list. The subsequent ‘s’ and ‘g’ of msg produce nothing nor does the normally triggering dot or full stop after msg (msg.) Even the simplest printf produces only private, protected, and pragma, but printf is never an option.
I have uninstalled and reinstalled VS Code to no avail. I have also deleted all extensions and reinstalled them as per Completely uninstall VS Code extensions, again, without success. A simple piece of code compiled without issue, but when I changed the source code file for something a little more complicated the following messages appeared.
Please update #include errors detected. Please update your includePAth. IntelliSense features fro this translation unit(C/NOTES/Programming/VSCODE/helloworld.cp) will be provided by the tag parser
*[2/1/2023, 10:54:07 PM] For C++ source files, IntelliSenseMode was changed from "windows-gcc-x64" to "windows-msvc-x64" based on compiler args and querying compilerPath: "C:\ghcup\ghc\9.2.5\mingw\bin\gcc.exe"
[2/1/2023, 10:54:07 PM] For C source files, IntelliSenseMode was changed from "windows-gcc-x64" to "windows-msvc-x64" based on compiler args and querying compilerPath: "C:\ghcup\ghc\9.2.5\mingw\bin\gcc.exe"*
Is it a case of IntelliSense looking at the C compiler (gcc.exe) and not the C++ compiler (g++.exe) and if so how can I change that?

Visual Studio Code error: "No project found in root directory. Please create a project file and add it to the configuration."

I am setting up VSCode for Ada. I typed in a known good test program and tried to "Run -> Start Debugging". In the PROBLEMS (Crtl+Shift+M) window, a message appears:
"No project found in root directory. Please create a project file and add it to the configuration."
I have read the documentation and looked around in the VSCode editor and have not found anything to correct this error. Can someone provide suggestions? Thanks.
The language extension is looking for a project file (.gpr file). Here are some instructions to set that up: https://github.com/AdaCore/ada_language_server/wiki/Getting-Started
I saw some extra procedures inside the extension itself. There were extra steps to complete the setup. I started Ada programming with a simple text editor and the gnat compiler so these additional steps were not anticipated. Sorry for the trouble.

Extension for OmniSharp

Is there any way to get an extension point in omnisharp-roslyn?
I see that omnisharp.exe has the "--plugin" argument, but the digging in the source code did not give me an answer: how to use this argument.
I need a way to include my assemblies in mef composition, so I can import Roslyn and OmniSharp services and export my ICodeActionProvider.
Plugins/extensions are a work in progress for the omnisharp-roslyn project.
There's an open PR for it.

How do I set unicode as character set in the ALL_BUILD and ZERO_CHECK Visual Studio 2013 projects that are generated by Cmake?

I am currently using CMake to create a bunch of Visual Studio 2013 projects and it works.
However, the automatically created ZERO_CHECK and ALL_BUILD projects are set to use MBCS by default although I want them to use the Unicode character set.
I did specify the use of the Unicode character set for my projects with the following :
ADD_DEFINITIONS(-DUNICODE)
ADD_DEFINITIONS(-D_UNICODE)
and it worked. I tried to set the c++ compiler flags with something like :
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /UMBCS /D_UNICODE /DUNICODE")
or even :
ADD_DEFINITIONS(-DUNICODE)
ADD_DEFINITIONS(-D_UNICODE)
before my project settings, but it did not affect ZERO_CHECK and ALL_BUILD at all.
Any Ideas ?
You could use cmake --build . -- /p:CharacterSet=Unicode to build your project with Unicode set as characterset.
In fact by this way you pass a parameter to do this to MSBuild itself, not CMake.
I found a solution.
Thanks to Mike, I realized I was searching in the wrong direction.
Since CMake does not give access to the meta-targets (and I can understand why), one must
set up the Visual Studio environment to make MFC compile with MBCS.
This link explains why Microsoft did remove native MBCS support for MFC projects and this link provides a download for the MFC-MBCS package.
I'll remain careful with this because I still want my projects to use Unicode, and I'll use CMake flags accordingly. However, ZERO_PROJECT and ALL_BUILD now compile just fine.
It is Raman Sharma's post that made me finally see the light.
Thanks you guys, you made my day :D
Best regards !
RL
In my case in cmake file CMAKE_MFC_FLAG was set to non-zero value:
if(NOT WIN_HEAPINSPECTOR)
#static link runtime lib
set(CMAKE_MFC_FLAG 1)
elseif()
#dynamic link runtime lib
set(CMAKE_MFC_FLAG 2)
endif()
I changed it to 0 and then it compiled.
ZERO_CHECK and ALL_BUILD are meta-targets. All your projects depend on ZERO_CHECK, all your projects are dependencies of ALL_BUILD, but those two projects themselves do not produce any libraries or executables, thus you need not to care about their build settings.
There could also be other such meta-targets, e.g. INSTALL if you used install() function.

Subversion/Git ignore settings for any language/IDE

I ran into the issue that when I start a new project in a new language or a new IDE I never know what to put in my Git-ignore file (or subversion ignore, they should ignore the same files either way) So I figured I should ask the always knowledgeable SO.
For example: for C# With Visual Studio I ignore:
/bin
/obj
*.user
*.suo
note: Specifically I am wondering about VHDL with Quartus 10.1 however I would love to see a nice list going here!
Take a look at https://github.com/github/gitignore for some example configurations.