请教一下各位大神,有没有什么方法可以给lsp程序自动排版的?
有时候国外下载的程序,或者复制过来的代码,排版非常错乱。
如下一个例子:
请问有没有什么程序或者插件,可以达到直接给lsp自动排版的效果。
我知道notepad++ ,有一个插件可以给html自动排版的,但是给lsp自动排版的插件,我没有找到。
麻烦知道方法的朋友,帮忙解答一下,谢谢了。
- ; This routine runs the code in the active editor of NotePad++ from AutoCAD:(defun C:n++ nil (C:RunFromNotePadPP)) ; Quick Run(defun C:RunFromNotePadPP ( / scr *error* err np++ npeditor npSS npMS r ) ; NOTE: Requires ActiveX plugin(by David Gausmann) installed on the NP++ ; (defun *error* (m) (foreach x (reverse (list np++ npeditor npSS npMS)) (vl-catch-all-apply (function vlax-release-object) (list x)) ) (gc) (gc) (and msg (or (wcmatch (strcase msg) "*BREAK,*CANCEL*,*EXIT*") (princ (strcat "\nError: " msg)))) (princ) ); defun *error* (setq err (vl-catch-all-apply (function (lambda nil ; THIS WORKS - IT GETS THE ACTIVE DOCUMENT CODE IN NOTEPAD !!! (setq np++ (vlax-get-or-create-object "NotepadPlusPlus.Application")) (setq npeditor (vlax-get np++ 'ActiveEditor)) (vlax-invoke-method npeditor 'selectAll) (setq npSS (vlax-get npeditor 'selections)) (setq npMS (vlax-get npSS 'mainSelection)) (setq r (vlax-get-property npMS 'text)) (vlax-invoke npSS 'setRange 0 0 0 0) ); lambda ); function ); vl-catch-all-apply ); setq err (*error* nil)(princ) (if (and r (not (vl-catch-all-error-p err))) (eval (read (strcat "(list\n" r "\n)"))) )); defun
|