Go to Definition and Find References not working - visual-studio-code

I'm interested in Visual Studio Code, the new editor Microsoft released a year and a half ago. If I can get the hang of it, I think I'll switch to it on my Ubuntu. So I've done a "Hello, World!" program trying to find how to configure and use VSC's features.
I've seen on VSC's site and on some videos how to configure a folder so that you could go to definitions and find references, but it nonetheless doesn't seem to work for me. I don't know if I've done something wrong or if it's a bug on VSC's part.
Here is what my folder looks like. I've basically set up the tasks.json, launcher.json and c_cpp_properties.json files with default setup (compiling and debugging work just fine), but as you can see in the screenshot below, no indexing seems to be taking place since no symbol is found in main.cpp (even if I add new functions). Also, trying to find references of the i variable leads to No results, and asking to find i's definition doesn't do anything.
I've already tried :
Reinstalling VSC
Removing plugins
Adding the ${workspaceRoot} folder in the c_cpp_properties.json's include for Linux
Here's the screenshot. Notice my installed extensions on the left.
Nothing I've seen has helped me understand what the problem is. Have I done something wrong? I'm on Ubuntu 16.04.

Several binaries of the Microsoft C/C++ vscode extension for Linux are 64-bit. Therefore, if you're on 32-bit Linux, some of the cpptools functionality won't work. You can check the issue on GitHub.

I work also with Microsofts plugin C/C++ in a quite big C project. The C symbol references works good. Maybe you can try to add your projects root directory to "includePath" in c_cpp_properties.json.
But I am pretty sure, that local variables of functions are not parsed.

Maybe does the C++ intellisense plugin conflict with the Microsoft C++ plugin. can you disable the plugin provided by Austin
? The Clang plugin is also not necessary. The Microsoft plugin has Clang support and code completion integrated.

When I asked my question, I was on an Ubuntu VM. Yesterday, I installed an Ubuntu partition on my HDD, and vscode worked perfectly, with peek definition, find references etc.
After a few hours, I ended up in the same situation as when I made my post. But then I just closed and reopened VSCode, and it worked again. Definitely a VSCode bug.
EDIT : Seems to be the same issue as this one.

Related

`Haskell` extension for `VSCode` not working on `Linux`

I installed ghcup and:
Stack 2.9.1
HLS 1.8.0
cabal 3.6.2
GHC 9.2.5
All of them are the recommended versions(I verified it using ghcup tui). Then I installed the Haskell extension in VSCode. Unfortunately, it doesn't work. I get syntax highlighting (from the Haskell Syntax Highlighting extension, which seems to be automatically installed alongside the Haskell extension) but there is no Intellisense, no code completion, no error detection and no interactive mode (-->>> evaluation). I experimented with different folders and haskell files. The filetype is correct, because every time I open a .hs file, the Haskell extension checks for updates. I even installed Codium, because I suspected a fault in VSCode, but it was the same there as well.
The hsl language server doesn't seem to be working in Neovim, either. I uninstalled ghcup (ghcup nuke) and reinstalled again. The result is exactly the same. I prepended the PATH and chose vanilla and non-vanilla Stack integration in either installations.
Am I doing something wrong?
OS: Linux Mint on Ubuntu 20.04.1, kernel 5.15.0-56.
After around 10 tries, I managed to fix the problem. It turned out I had three problems:
I had only 12 GB free on my Linux partition, but it seems more are needed. I realised it, when it turned out some haskell-language-server files were missing. I enlarged my Linux partition (something I should have done months ago). The new installation installed all files
The Haskell Language Server HLS was not added to the PATH. I solved it by putting this snippet in ~/.ghcup/config.yaml:
"haskell.serverEnvironment": {
"PATH": "${HOME}/.ghcup/bin:$PATH"
}
The server was now discovered by the Haskell VS Code extension but crashed 5 times and gave up on trying. Restarting it manually didn't help. I opened the logs: View->Output->Haskell and saw the error:
haskell-language-server-wrapper: /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.32' not found (required by haskell-language-server-wrapper)
It turns out, my Linux Mint distribution uses GLIBC_2.31, not 2.32. This is a very important library, which most applications on the system use. If you are a newbie, it is strongly advised that you DO NOT update it manually.
Instead, what I did, was install a version of the HLS, which used GLIBC_2.31. This problem occured in September and was "fixed" but apparently not very well. There are two options:
download the HLS deb10 version manually (didn't work for me):
ghcup install hls -u https://downloads.haskell.org/~hls/haskell-language-server-1.8.0.0/h
download using ghcup tui HLS version 1.7.0.0 (or whatever newest, which uses your glibc version) and a GHC, which supports that particular version of the HLS (in my case 9.0.2).
I think it's a good idea to preemptively reinstall the extension, in case it used the PATH to configure the HLS, so that its settings are restored to default. It takes up to 20 seconds to initialize the server, so be patient. You can see what's happening in the Output window and verify there are no more errors.
I hope this helps.

When I install SASS with NPM, where is the executable on my computer?

I am developing in Windows 10. I do some of my web development in Eclipse and like to use SASS in developing my CSS. Eclipse needs to access SASS in order to compile the SCSS into CSS.
I went to the SASS website and they give a variety of options for installing SASS. I chose to install it with npm and did so successfully on my C: drive. Now I need to know the name of the SASS executable and where it is on my C: drive so I can point to it in my Eclipse tool builders.
I've tried searching for files containing "sass" in the file name but the Windows search utility is useless: it's been running for hours and most of the file names it finds don't even contain "sass". It finds nothing at all when I search on "sass.exe".
I got it working on my own.
First, I should explain that I was initially using Ruby Sass but that wouldn't work when I tried to use it yesterday for the first time in a few months. I vaguely remember something about Ruby Sass being scheduled for deprecation so maybe that's why it stopped working suddenly? Anyway, I needed it to work again but found the information at the SASS website so vague as to raise more questions than it answered so I posted here.
Insomnia has me up in the middle of the night so I started digging and decided to try the SASS website again. This time, I opted for the "Install Anywhere (standalone)" instructions and grabbed Dart SASS. It wasn't intuitively obvious how to install that either but I searched here at StackOverflow and found this article, which I followed carefully.
I found that for my particular situation, I didn't need to create the two files, style.css and style.scss, and I didn't have to execute the watch command either. However, the syntax of the SASS command for the Eclipse Builder had changed a bit: --sourcemaps=none changed to --no-source-maps and I didn't need the --style parameter at all since the default value for style is exactly what I wanted, namely expanded. By the way, the executable isn't an .exe file, it's sass.bat.
Now my SCSS compiles to CSS cleanly and I'm back in business.

Pony language on Windows with VS2017 or VSCode

I am looking for a complete instruction on how to setup Pony and make VS2017 or VSCode recognize its syntax, compile and debug program.
So far I've found a plugin for VS2015 (https://github.com/ponylang/VS-pony); however I cannot build the project (project is of course being converted to VS2017 format by VS2017 itself). I've also found some syntax colorizer for VSCode; however I have no clue how to configure building pipe, not mentioning the debugging environment.
Ps. On YouTube there is a lecture on Pony and guys there seem to use VSCode (https://www.youtube.com/watch?v=Vq1vRfv-A6g).
How did they do that? Does any one know?
Currently the plugin only supports syntax highlighting. I haven’t used it myself, but if you go to the Pony mailing list you might be able to find someone who has more information. I believe Sylvan is using Sublime Text in the video you linked to.

gtk+ without msys2 mingw

On Windows, trying something with gtk+. I have downloaded Msys2, along with gtk+3.0.
Successfully compiled all the gtk+3.0 examples in the msys2 mingw-w64 terminal.
Now I want to move a bit further to try work without the msys environment.
I opened up cmd and navigated to where the example executables are compiled. Then I fired them up by typing "example.exe".
libgio-2.0-0.dll missing, not surprised. I go back to check the PATH environment of the msys environment, PATH=/mingw64/bin/:/usr/local/bin:/usr/bin/:/bin:/c/Windows/System32:..blablabla
So in the cmd environment I did set PATH=%PATH%;pathto/mingw64/bin; and run example.exe again.
This time it gave a very strange error cannot find entrypoint inflateValidate (in dll libpng16-16.dll)
So I checked, indeed there was no inflateValidate function in the dll. it seemed to me that something thought the function is in the dll and tried to call it but because it doesn't exist so it failed. What I don't understand is that why did it not fail in the msys environment but failed in the windows environment. And does that bring any impact to me if I am going to ship any gtk application? I thought simply distributing the relevant dll would be enough.
I have tried instead of adding the mingw64/bin path to the PATH variable, but copying the required dll the the execute location 1 by 1, but at the end it still gave the same error.
I have also tried to search for other libpng*.dll in my computer, none of them contained the inflateValidate function.
If anyone know whats going on please shed some light to the question.
I might be very late to the party but I ran into the same issue yesterday (missing the inflateValidate symbol) and after checking the contents of the zlib1.dll file could ascertain that the function is just not there.
I downloaded another version (specifically this one https://sourceforge.net/projects/uqm-mods/files/latest/download, though I am in no way affiliated to this project) and saw that the inflateValidate symbol was indeed declared, so I suppose that the zlib bundled with your files is not up to date with the libpng requirements.
This solved my problem. I hope it solves yours too.

A Java Development Kit must be available in order to run Eclipse

I was able to run Eclipse until I tried to install another compiler, suggested by a online tutorial for C++. Now I'm getting the 'No virtual machine was found error'. I know I'm suppose to match the versions of the programs but I can't seem to figure it out. I thought I had downloaded 64 bit version of each program in Eclipse and JDK but I don't know how to verify it. I go to each file and try to get the info but I must be looking in the wrong places. I have copied the file location of JDK and pasted it in the Advanced System Settings in Environment Variables. In the Systems Variables for User on the variable line I typed "path", on the value line I pasted the location: C:\Program Files\Java\jdk1.8.0_05\bin. I have even uninstalled both programs several times and reinstalled them. I've been at it for several hours now with no success. Any suggestions, anybody. Thank you.