-
-
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
Vala language server not working properly #318
Comments
Have you read the important note in the "Editors" section?: https://github.com/vala-lang/vala-language-server?tab=readme-ov-file#editors
Also see: https://github.com/vala-lang/vala-language-server?tab=readme-ov-file#specifying-dependencies Confirm if you're following these instructions and the issue is still happening. |
I am not using any build system, I am only using a Makefile for automatic building all:
valac MDEditor.vala --pkg gtk4 And I have installed vscode vala extension and vala language server But it only works for GLib and not Gtk and etc. |
Try using something like bear: 'bear -- make' |
Problem is vala is only showing intellisence for GLib and no other libraries |
That behaviour is normal if a project isn't setup properly to be used with Vala Language Server. Autotools projects aren't supported by the langauge server (See "supported projects"). Please try the solution that @ErikReider suggested. It should generate a If that doesn't work, I recommend using Meson. Vala Language Server works well with Meson projects. |
I am not using meson. Is there a default configuration you know which I can use? |
After installing meson init -l vala It will create a project for you and provide you with instructions on how to setup a build directory and compile your project. |
And any configuration for vala vscode for gtk? |
The Vala extension doesn't need to be configured to work with GTK. The meson project does. It's possible to figure it out with a bit of research. |
But it's language server not working for gtk, |
Again, the issue is not the language server. Vala is a compiled langauge so the language server needs to how to compile the code for it to work. The issue is that your project isn't setup to be used with the language server. For Meson, you just need to add dependencies = [
dependency('glib-2.0'),
dependency('gobject-2.0'),
dependency('gtk4'), # Add this line
] |
It is, Compiler is working properly but language server isn't working for gtk, it is only working for GLib |
How did you compile the code? With |
Follow these steps:
You can check out some of my projects as a reference point :) |
By valac all:
valac MDEditor.vala --pkg gtk4 It is working properly |
Ok. Follow @ErikReider's steps then let us know what happens |
Describe the bug
Am I missing to install something?
base type
null' of class
MDEditor' is not an object typeMy code:
jaipal001@pop-os:~/Desktop/files/syntax-prview$ valac --verbose=med MDEditor.vala
Loaded package
/usr/share/vala-0.56/vapi/glib-2.0.vapi' Loaded package
/usr/share/vala-0.56/vapi/gobject-2.0.vapi'MDEditor.vala:12.38-12.40: error: The symbol `Gtk' could not be found
12 | public class MDEditor : GLib.Object, Gtk.Application {
| ^~~
Compilation failed: 1 error(s), 0 warning(s)
Software
OS and version Pop OS 24.04:
Code editor: VSCode:
Vala Language Server installed by ubuntu binaries:
Vala version: Vala 0.56.0
The text was updated successfully, but these errors were encountered: