mirror of
https://github.com/godotengine/emacs-gdscript-mode.git
synced 2026-01-04 18:09:55 +03:00
Use constants and eval on compile for completion keywords
This commit is contained in:
@@ -42,7 +42,8 @@
|
|||||||
(let* ((bounds (bounds-of-thing-at-point 'symbol))
|
(let* ((bounds (bounds-of-thing-at-point 'symbol))
|
||||||
(start (car bounds))
|
(start (car bounds))
|
||||||
(end (cdr bounds)))
|
(end (cdr bounds)))
|
||||||
(list start end gdscript--completion-keywords . nil)))
|
(list start end gdscript-completion--all-keywords
|
||||||
|
. nil)))
|
||||||
|
|
||||||
(provide 'gdscript-completion)
|
(provide 'gdscript-completion)
|
||||||
|
|
||||||
|
|||||||
@@ -33,14 +33,14 @@ highlighting."
|
|||||||
(insert-file-contents (concat (file-name-directory (or load-file-name buffer-file-name)) file-path))
|
(insert-file-contents (concat (file-name-directory (or load-file-name buffer-file-name)) file-path))
|
||||||
(split-string (buffer-string) "\n" t)))
|
(split-string (buffer-string) "\n" t)))
|
||||||
|
|
||||||
(defvar gdscript-keywords (gdscript--get-package-file-content-as-string "data/keywords.txt"))
|
(defconst gdscript-keywords (gdscript--get-package-file-content-as-string "data/keywords.txt"))
|
||||||
(defvar gdscript-built-in-constants (gdscript--get-package-file-content-as-string "data/built-in-constants.txt"))
|
(defconst gdscript-built-in-constants (gdscript--get-package-file-content-as-string "data/built-in-constants.txt"))
|
||||||
;; Only contains types that are not classes and that the Godot editor highlights
|
;; Only contains types that are not classes and that the Godot editor highlights
|
||||||
;; like built-in keywords
|
;; like built-in keywords
|
||||||
(defvar gdscript-built-in-types (gdscript--get-package-file-content-as-string "data/built-in-types.txt"))
|
(defconst gdscript-built-in-types (gdscript--get-package-file-content-as-string "data/built-in-types.txt"))
|
||||||
(defvar gdscript-built-in-functions (gdscript--get-package-file-content-as-string "data/built-in-functions.txt"))
|
(defconst gdscript-built-in-functions (gdscript--get-package-file-content-as-string "data/built-in-functions.txt"))
|
||||||
;; Contains all engine classes and node types, including vectors, transforms, etc.
|
;; Contains all engine classes and node types, including vectors, transforms, etc.
|
||||||
(defvar gdscript-built-in-classes (gdscript--get-package-file-content-as-string "data/built-in-classes.txt"))
|
(defconst gdscript-built-in-classes (gdscript--get-package-file-content-as-string "data/built-in-classes.txt"))
|
||||||
|
|
||||||
(defun regex-maker (words)
|
(defun regex-maker (words)
|
||||||
(regexp-opt words 'symbols))
|
(regexp-opt words 'symbols))
|
||||||
|
|||||||
Reference in New Issue
Block a user