mirror of
https://gitlab.gnome.org/jwestman/blueprint-compiler.git
synced 2025-05-04 15:59:08 -04:00
lsp: Add code actions
"Did you mean" hints are automatically converted into code actions.
This commit is contained in:
parent
d89f2356b4
commit
d511b3f1e3
5 changed files with 82 additions and 16 deletions
|
@ -388,9 +388,9 @@ class GirContext:
|
|||
return None
|
||||
|
||||
|
||||
def validate_class(self, name: str, ns: str):
|
||||
def validate_ns(self, ns: str):
|
||||
""" Raises an exception if there is a problem looking up the given
|
||||
class (it doesn't exist, it isn't a class, etc.) """
|
||||
namespace. """
|
||||
|
||||
ns = ns or "Gtk"
|
||||
|
||||
|
@ -400,6 +400,14 @@ class GirContext:
|
|||
did_you_mean=(ns, self.namespaces.keys()),
|
||||
)
|
||||
|
||||
|
||||
def validate_class(self, name: str, ns: str):
|
||||
""" Raises an exception if there is a problem looking up the given
|
||||
class (it doesn't exist, it isn't a class, etc.) """
|
||||
|
||||
ns = ns or "Gtk"
|
||||
self.validate_ns(ns)
|
||||
|
||||
type = self.get_type(name, ns)
|
||||
|
||||
if type is None:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue