Browse Source

better hover message for signals
Release 0.1.5

Geequlim 8 năm trước cách đây
mục cha
commit
7e68ae318a
4 tập tin đã thay đổi với 25 bổ sung4 xóa
  1. 6 0
      CHANGELOG.md
  2. 7 0
      README.md
  3. 1 1
      package.json
  4. 11 3
      src/gdscript/symbolparser.ts

+ 6 - 0
CHANGELOG.md

@@ -1,5 +1,11 @@
 # Change Log
 
+### 0.1.5
+
+* Add function signature hint support
+* Better syntax grammar checking
+* Better hover hint message for workspace methods and signals
+
 ### 0.1.4
 
 * Add documentation support for builtin Symbols.

+ 7 - 0
README.md

@@ -53,6 +53,13 @@ The [Godot Tools](https://github.com/GodotExplorer/godot-tools) and the go to [e
 
 ## Release Notes
 
+### 0.1.5
+
+* Add function signature hint support
+* Better syntax grammar checking
+* Better hover hint message for workspace methods and signals
+
+
 ### 0.1.4
 
 * Add documentation support for builtin Symbols.

+ 1 - 1
package.json

@@ -3,7 +3,7 @@
   "displayName": "Godot Tools",
   "icon": "icon.png",
   "description": "\"Tools for game development with godot game engine\"",
-  "version": "0.1.4",
+  "version": "0.1.5",
   "publisher": "geequlim",
   "engines": {
     "vscode": "^1.5.0"

+ 11 - 3
src/gdscript/symbolparser.ts

@@ -76,15 +76,23 @@ class GDScriptSymbolParser {
         const signature = line.substring(line.indexOf("("), line.indexOf(")")+1);
         if(signature && signature.length >0) {
           script.signatures[key] = signature;
-          // console.log(key, signature);
         }
       }
     }
     
     let signalnames = getMatches(text, /signal\s+([_A-Za-z]+[_A-Za-z0-9]*)\s*\(/g, 1);
     const signals = findLineRanges(signalnames, "signal\\s+$X$\\s*\\(");
-    for (let key of Object.keys(signals))
-      script.signals[key] = determRange(key, signals);
+    for (let key of Object.keys(signals)) {
+      let r: Range = determRange(key, signals);
+      script.signals[key] = r;
+      const line = lines[r.start.line];
+      if(line.indexOf("(")!= -1 && line.indexOf(")")!=-1) {
+        const signature = line.substring(line.indexOf("("), line.indexOf(")")+1);
+        if(signature && signature.length >0) {
+          script.signatures[key] = signature;
+        }
+      }
+    }
 
     let varnames = getMatches(text, /var\s+([_A-Za-z]+[_A-Za-z0-9]*)\s*/g, 1);
     const vars = findLineRanges(varnames, "var\\s+$X$\\s*");