-
-
Notifications
You must be signed in to change notification settings - Fork 44
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
CMake support #73
Comments
Right now you don't have to worry much about this. We will be using it later as we develop tests for VLS. If you're curious you can run
Sorry, could you explain this more? Are you saying that clicking "goto references" doesn't list all references in the project? Or something else? |
Here's an example from namespace pdfpc {
public class Application: GLib.Object {
private PresentationController controller;
...
The class
Even though there is a file: presentation_controller.vala with namespace pdfpc {
public class PresentationController : Object {
... Go to reference, peek, nothing works, since intellisense cannot pick it up. This is not limited to local definitions. For example With C files I am able to add the paths to |
@LecrisUT Ah! Is this your project: https://github.com/pdfpc/pdfpc ? It looks like this project is CMake-based, which is a backend we intend to support in the future but don't currently. At first, we've chosen to support Meson, since the vast majority (perhaps >90%) of Vala projects use Meson, and the rest almost all use automake/autoconf. This in fact is the first Vala project I've seen that uses CMake, and this will be a useful test-case for when we're implementing CMake support. If VLS can't detect a meson project, it will simply treat every folder as a separate compilation unit, so this is probably why you're not seeing references to files across different directories. |
Ok. I've confirmed that it does work like that for local files. So I guess the I have tested benwaffle/vala-starter. It does indeed take me to the appropriate links when using meson. |
@LecrisUT yes, without knowledge of compile arguments, the libraries you need will not be included. |
It looks like this is how we can introspect a CMake project in a similar fashion to what we do for Meson: https://cmake.org/cmake/help/latest/manual/cmake-file-api.7.html |
Wouldn't it be possible to just use compile_commands.json ? That should work for both meson and CMake (and possibly for future build systems too). |
@Cogitri no, because compile_commands.json only includes compile commands, not things like |
Basically, there's a lot of useful information left out in |
It seems that Vala projects using CMake rely on unofficial macros from here: https://github.com/jakobwesthoff/Vala_CMake/ CMake's file API allows a program to get the list of targets and their sources in a JSON file. The unofficial Vala CMake macros above use I've made some initial changes to these macros here. This seems to work with a single Vala target, but I want to see how this works with multiple Vala targets: in particular, whether we can get the JSON output in such a way that the dependency graph can be reconstructed. |
Also, it would help to know of more Vala projects that use CMake. pdfpc seems like the only one I could find. |
If pdfpc is the only major Vala codebase that uses CMake, perhaps it would be better to encourage they switch to Meson. |
Hmm... it looks like Dino, another very popular (1.5k stars) project, uses CMake too. |
Though not anymore, the elementary OS project's Vala applications were built with CMake. Many projects on GitHub use CMake (code search for the "FindVala" CMake module). |
@chances most of those projects are dead, save a handful. |
That doesn't mean none of them will be revived in the future. |
@chances well I still have to prioritize support for the things that people are currently using. If and when what you said happens, then CMake will become a higher priority. |
I am trying to get a
homebrew
+VS Code
setup to work. So far I have managed to install the server. I am not sure how to runvls-testclient
to confirm the installation was successful or not.Running
VS Code
I get the following errors (trimmed down for readability, hope I didn't miss something important):The cross-reference barely works, and it doesn't seem to reference different files in the workspace. Let me know if you need any more debug information or testing
The text was updated successfully, but these errors were encountered: