Make symbols pseudo-private, update README and CHANGELOG

This commit is contained in:
Nathan Lovato
2020-05-28 10:06:11 -06:00
parent ef3f0c529f
commit 3e46706855
3 changed files with 32 additions and 30 deletions

View File

@@ -8,9 +8,10 @@ _Currently in development._
### Features
- Added commands to open the API reference in eww
- Added missing built in functions
- Added missing puppet and remotesync keywords
- Added commands to open the API reference in eww.
- Added debug options when running `gdscript-godot-run-project-debug`.
- Added missing built in functions.
- Added missing puppet and remotesync keywords.
- Added a command to insert a path to a project file, either using `project-find-file` if `projectile` is available, otherwise with `find-file`.
- Added a command to format a selected region with `gdformat`.
- Added syntax highlighting for function calls.

View File

@@ -136,17 +136,18 @@ If you don't have `godot` available there, you can set a custom executable name
You can also use `customize` to change this path: `M-x customize` and search for "godot".
### Running Godot with debugging options
### Running Godot with visual debug options
When running `gdscript-godot-run-project-debug` (binded by default to `C-c C-r C-d`) you can use prefix argument (ie. `C-u C-c C-r C-d`) to invoke mini-buffer selection with extra options to pass to godot.
When running `gdscript-godot-run-project-debug`, you can use the universal argument <kbd>C-u</kbd> to invoke a mini-buffer with extra options to pass to godot.
Available selection options are:
1) `<no options>` _(default)_
2) `--debug-collisions`
3) `--debug-navigation`
4) `--debug-collisions --debug-navigation`
Here are the available options:
Selected option is remembered for subsequent execution of `gdscript-godot-run-project-debug`, so do not forget to change selection back to `<no options>` if you do not need debug options any longer.
1. `<no options>` _(default)_
2. `--debug-collisions`
3. `--debug-navigation`
4. `--debug-collisions --debug-navigation`
The last selected option is saved for the next time you call `gdscript-godot-run-project-debug`. To remove debug options, you need to call the command with the universal argument again.
### Formatting code with gdformat

View File

@@ -36,9 +36,9 @@
(require 'gdscript-utils)
;;;###autoload
(defvar gdscript-godot-debug-selected-option 1)
(defvar gdscript-godot--debug-selected-option 1)
(defvar gdscript-godot-debug-options-alist
(defvar gdscript-godot--debug-options-alist
'((1 . "")
(2 . "--debug-collisions")
(3 . "--debug-navigation")
@@ -80,9 +80,9 @@ When run with prefix argument, it offers extra debug options to choose from."
(interactive)
(let* ((debug-option-index
(if current-prefix-arg
(gdscript-godot-change-debug-options)
gdscript-godot-debug-selected-option))
(debug-options (cdr (assoc debug-option-index gdscript-godot-debug-options-alist))))
(gdscript-godot--change-debug-options)
gdscript-godot--debug-selected-option))
(debug-options (cdr (assoc debug-option-index gdscript-godot--debug-options-alist))))
(gdscript-godot--run-command
(concat (gdscript-godot--build-shell-command) " -d " debug-options) t)))
@@ -118,31 +118,31 @@ For this to work, the script must inherit either from
(concat (gdscript-godot--build-shell-command) " -s " (file-relative-name buffer-file-name))
t))
(defun gdscript-godot-debug-options-collection ()
"List of debug options to choose from by *-read function."
(defun gdscript-godot--debug-options-collection ()
"Output a list of debug options to choose from by *-read function."
(list
(format "1) [%s] <no options>" (if (eq gdscript-godot-debug-selected-option 1) "X" " "))
(format "2) [%s] %s" (if (eq gdscript-godot-debug-selected-option 2) "X" " ") (cdr (assoc 2 gdscript-godot-debug-options-alist)))
(format "3) [%s] %s" (if (eq gdscript-godot-debug-selected-option 3) "X" " ") (cdr (assoc 3 gdscript-godot-debug-options-alist)))
(format "4) [%s] %s" (if (eq gdscript-godot-debug-selected-option 4) "X" " ") (cdr (assoc 4 gdscript-godot-debug-options-alist)))))
(format "1) [%s] <no options>" (if (eq gdscript-godot--debug-selected-option 1) "X" " "))
(format "2) [%s] %s" (if (eq gdscript-godot--debug-selected-option 2) "X" " ") (cdr (assoc 2 gdscript-godot--debug-options-alist)))
(format "3) [%s] %s" (if (eq gdscript-godot--debug-selected-option 3) "X" " ") (cdr (assoc 3 gdscript-godot--debug-options-alist)))
(format "4) [%s] %s" (if (eq gdscript-godot--debug-selected-option 4) "X" " ") (cdr (assoc 4 gdscript-godot--debug-options-alist)))))
(defun gdscript-godot-read-options ()
(defun gdscript-godot--read-debug-options ()
"Read debug options preference by user from mini-buffer."
(cond ((fboundp 'ivy-read)
(ivy-read "Options: " (gdscript-godot-debug-options-collection)))
(ivy-read "Options: " (gdscript-godot--debug-options-collection)))
((fboundp 'ido-completing-read)
(ido-completing-read "Options: " (gdscript-godot-debug-options-collection)))
(ido-completing-read "Options: " (gdscript-godot--debug-options-collection)))
(t
(completing-read "Options (hit TAB to auto-complete): " (gdscript-godot-debug-options-collection) nil t))))
(completing-read "Options (hit TAB to auto-complete): " (gdscript-godot--debug-options-collection) nil t))))
(defun gdscript-godot-change-debug-options ()
(defun gdscript-godot--change-debug-options ()
"Read debug option and parse it as a number.
Once read it is saved in `gdscript-godot-debug-selected-option'
Once read it is saved in `gdscript-godot--debug-selected-option'
variable for later use."
(let* ((option (gdscript-godot-read-options))
(let* ((option (gdscript-godot--read-debug-options))
(index (string-to-number option)))
(setq gdscript-godot-debug-selected-option index)))
(setq gdscript-godot--debug-selected-option index)))
(provide 'gdscript-godot)
;;; gdscript-godot.el ends here