Skip to content

Commit 7154e09

Browse files
author
arne
committed
add rudimentary eldoc support
1 parent 9e96a87 commit 7154e09

File tree

1 file changed

+42
-40
lines changed

1 file changed

+42
-40
lines changed

el/sclang-mode.el

Lines changed: 42 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -78,40 +78,40 @@
7878
(easy-menu-create-menu
7979
title
8080
'(
81-
["Start Interpreter" sclang-start :included (not (sclang-library-initialized-p))]
82-
["Restart Interpreter" sclang-start :included (sclang-library-initialized-p)]
83-
["Recompile Class Library" sclang-recompile :included (sclang-library-initialized-p)]
84-
["Stop Interpreter" sclang-stop :included (sclang-get-process)]
85-
["Kill Interpreter" sclang-kill :included (sclang-get-process)]
86-
"-"
87-
["Show Post Buffer" sclang-show-post-buffer]
88-
["Clear Post Buffer" sclang-clear-post-buffer]
89-
"-"
90-
["Switch To Workspace" sclang-switch-to-workspace]
91-
"-"
92-
["Evaluate Region" sclang-eval-region]
93-
["Evaluate Line" sclang-eval-region-or-line]
94-
["Evaluate Defun" sclang-eval-defun]
95-
["Evaluate Expression ..." sclang-eval-expression]
96-
["Evaluate Document" sclang-eval-document]
97-
"-"
98-
["Find Definitions ..." sclang-find-definitions]
99-
["Find References ..." sclang-find-references]
100-
["Pop Mark" sclang-pop-definition-mark]
101-
["Show Method Arguments" sclang-show-method-args]
102-
["Complete keyword" sclang-complete-symbol]
103-
["Dump Interface" sclang-dump-interface]
104-
["Dump Full Interface" sclang-dump-full-interface]
105-
"-"
106-
["Index Help Topics" sclang-index-help-topics]
107-
["Find Help ..." sclang-find-help]
108-
["Switch to Help Browser" sclang-goto-help-browser]
109-
["Open Help GUI" sclang-open-help-gui]
110-
"-"
111-
["Run Main" sclang-main-run]
112-
["Stop Main" sclang-main-stop]
113-
["Show Server Panels" sclang-show-server-panel]
114-
)))
81+
["Start Interpreter" sclang-start :included (not (sclang-library-initialized-p))]
82+
["Restart Interpreter" sclang-start :included (sclang-library-initialized-p)]
83+
["Recompile Class Library" sclang-recompile :included (sclang-library-initialized-p)]
84+
["Stop Interpreter" sclang-stop :included (sclang-get-process)]
85+
["Kill Interpreter" sclang-kill :included (sclang-get-process)]
86+
"-"
87+
["Show Post Buffer" sclang-show-post-buffer]
88+
["Clear Post Buffer" sclang-clear-post-buffer]
89+
"-"
90+
["Switch To Workspace" sclang-switch-to-workspace]
91+
"-"
92+
["Evaluate Region" sclang-eval-region]
93+
["Evaluate Line" sclang-eval-region-or-line]
94+
["Evaluate Defun" sclang-eval-defun]
95+
["Evaluate Expression ..." sclang-eval-expression]
96+
["Evaluate Document" sclang-eval-document]
97+
"-"
98+
["Find Definitions ..." sclang-find-definitions]
99+
["Find References ..." sclang-find-references]
100+
["Pop Mark" sclang-pop-definition-mark]
101+
["Show Method Arguments" sclang-show-method-args]
102+
["Complete keyword" sclang-complete-symbol]
103+
["Dump Interface" sclang-dump-interface]
104+
["Dump Full Interface" sclang-dump-full-interface]
105+
"-"
106+
["Index Help Topics" sclang-index-help-topics]
107+
["Find Help ..." sclang-find-help]
108+
["Switch to Help Browser" sclang-goto-help-browser]
109+
["Open Help GUI" sclang-open-help-gui]
110+
"-"
111+
["Run Main" sclang-main-run]
112+
["Stop Main" sclang-main-stop]
113+
["Show Server Panels" sclang-show-server-panel]
114+
)))
115115

116116
(defun sclang-fill-mode-map (map)
117117
;; process control
@@ -154,7 +154,7 @@
154154
(define-key map "*" 'sclang-electric-star)
155155
;; menu
156156
(let ((title "SCLang"))
157-
(define-key map [menu-bar sclang] (cons title (sclang-mode-make-menu title))))
157+
(define-key map [menu-bar sclang] (cons title (sclang-mode-make-menu title))))
158158
;; return map
159159
map)
160160

@@ -308,7 +308,7 @@
308308
(list
309309
;; classes
310310
(cons 'sclang-font-lock-class-keyword-matcher 'font-lock-type-face)
311-
;; (cons (concat "\\<" sclang-class-name-regexp "\\>") 'font-lock-type-face)
311+
;; (cons (concat "\\<" sclang-class-name-regexp "\\>") 'font-lock-type-face)
312312
))
313313
;; default level
314314
sclang-font-lock-keywords sclang-font-lock-keywords-1
@@ -600,14 +600,14 @@ Returns the column to indent to."
600600

601601
(sclang-set-command-handler
602602
'_documentPutString
603-
(lambda (arg)
603+
(lambda (arg)
604604
(cl-multiple-value-bind (id str) arg
605605
(let ((doc (and (integerp id) (sclang-get-document id))))
606606
(when doc
607607
(with-current-buffer doc
608-
(insert str)
609-
)
610-
nil)))))
608+
(insert str)
609+
)
610+
nil)))))
611611

612612
(sclang-set-command-handler
613613
'_documentPopTo
@@ -655,6 +655,8 @@ Returns the column to indent to."
655655
'sclang-font-lock-syntactic-face)
656656
(set (make-local-variable 'font-lock-defaults)
657657
sclang-font-lock-defaults)
658+
;; eldoc
659+
(set (make-local-variable 'eldoc-documentation-function) 'sclang-show-method-args)
658660
;; ---
659661
nil)
660662

0 commit comments

Comments
 (0)