diff src/vim9type.c @ 31706:824fc05d9571 v9.0.1185

patch 9.0.1185: using class from imported script not tested Commit: https://github.com/vim/vim/commit/a86655af84f1596f0f3ef22813724fe06f1e4809 Author: Bram Moolenaar <Bram@vim.org> Date: Thu Jan 12 17:06:27 2023 +0000 patch 9.0.1185: using class from imported script not tested Problem: Using class from imported script not tested. Solution: Add tests. Implement what is missing.
author Bram Moolenaar <Bram@vim.org>
date Thu, 12 Jan 2023 18:15:05 +0100
parents 69ee530cac28
children 50241d494268
line wrap: on
line diff
--- a/src/vim9type.c
+++ b/src/vim9type.c
@@ -982,7 +982,9 @@ skip_type(char_u *start, int optional)
 
     if (optional && *p == '?')
 	++p;
-    while (ASCII_ISALNUM(*p) || *p == '_')
+
+    // Also skip over "." for imported classes: "import.ClassName".
+    while (ASCII_ISALNUM(*p) || *p == '_' || *p == '.')
 	++p;
 
     // Skip over "<type>"; this is permissive about white space.
@@ -1091,7 +1093,7 @@ parse_type(char_u **arg, garray_T *type_
     char_u  *p = *arg;
     size_t  len;
 
-    // skip over the first word
+    // Skip over the first word.
     while (ASCII_ISALNUM(*p) || *p == '_')
 	++p;
     len = p - *arg;
@@ -1293,10 +1295,10 @@ parse_type(char_u **arg, garray_T *type_
 	    break;
     }
 
-    // It can be a class or interface name.
+    // It can be a class or interface name, possibly imported.
     typval_T tv;
     tv.v_type = VAR_UNKNOWN;
-    if (eval_variable(*arg, (int)len, 0, &tv, NULL, EVAL_VAR_IMPORT) == OK)
+    if (eval_variable_import(*arg, &tv) == OK)
     {
 	if (tv.v_type == VAR_CLASS && tv.vval.v_class != NULL)
 	{