欢迎使用 Nox -- 轻量级 LSP 客户端

也许要需要安装 exec-path-from-shell ,而且我不确定Emacs会从 .zsh 里面去读取PATH配置。

1 个赞

果然是这个问题,加入(exec-path-from-shell-initialize) 可以正常识别环境变量了。

喜欢! 从来不用flycheck和snippet自动补全功能的我为大佬点赞!

2 个赞

@manateelazycat 猫哥,今晚在Win10下调试了Nox+ mspyls,只要修改下nox.el 2309 行加一条语句就可以完美支持Win10 系统。
(if (eq system-type 'windows-nt) ".exe" "")

有空能否更新一下,方便更多地朋友使用。

(defun nox--python-contact (interactive)
  (cond ((string-equal nox-python-server "mspyls")
         (setq-default nox-workspace-configuration
                       '((:python :autoComplete (:extraPaths nil)
                                  :analysis (:autoSearchPaths :json-false :usePYTHONPATH :json-false))))
         (cons 'nox-mspyls (list (concat nox-python-server-dir
                                         "Microsoft.Python.LanguageServer"
                                         (if (eq system-type 'windows-nt) ".exe" "")))))
        ((string-equal nox-python-server "pyls")
         (list "pyls"))
        ))
1 个赞

已经搞定了, 更新即可

1 个赞

感谢 :smile:
这样Windows 用户只要自己再设置下python路径就可以愉快地使用mspyls了。
例如: (setq nox-python-path "c:/Python38/python.exe")

2 个赞

目前使用Nox,在Mac 和 Linux 都正常。但在Windows下有点小问题:
通过kill-this-buffer 关闭所有*Nox(xxxxx)* buffer时会造成emacs 冻结。
虽然对使用影响不太大,但是有时不小心关闭这些nox buffer时就得重启emacs。由于冻结住了,很难debug。有用过nox的朋友遇到这个问题吗?

有个问题: java项目下不能 auto guess project root,设置 project root 开启 nox 后,只有第一个 java 文件能正常补全,打开其他的 java 文件会另起一个 nox workspace

请问有人在使用Nox实现C#的自动补全和跳转吗? 我用Nox尝试连接,总是不成功。
不知道Nox 需要什么样的参数可以连接?

经过测试,目前C#在Emacs上的语法高亮可以使用Csharp-mode, 配合omnisharp-emacs 连接omnisharp-roslyn Sever 正常工作。

Nox是Forked自eglot的,在eglot上有人通过以下配置可以成功连接omnisharp-roslyn

  (use-package eglot
  :commands (eglot eglot-ensure)
  :hook ((python-mode . eglot-ensure)
         (csharp-mode . eglot-ensure))
  :config
  (progn
    (define-key eglot-mode-map (kbd "C-c e r") 'eglot-rename)
    (define-key eglot-mode-map (kbd "C-c e f") 'eglot-format)
    (define-key eglot-mode-map (kbd "C-c e h") 'eglot-help-at-point)
    (add-to-list 'eglot-server-programs
                 `(csharp-mode . ("C:/Home/omnisharp_64/OmniSharp.exe" "-lsp")))))

系统:Windows 10,Mac
emacs 28.0.50/ 27.0.91

显然不是,我最新的电脑也卡的

楼主加油,关注中,等有空了在spacemacs中试试。

我用Nox 在 mspyls和haskell 以及ccls感觉都很好啊,没觉得卡。我只测试过Windows和mac

打开go文件 M-x nox 返回

[nox]Server reports (type=2): You are neither in a module nor in you GOPATH. If you are using modules, please open your editor at the directory containing the go.mod.

我在用module,用lsp-mode的时候没问题或者会让import project,使用nox的时候如何让它识别go项目呢。

spacemacs 中如何安装配置?

1 个赞

spacemacs中不知道如何使用nox

dotspacemacs-additional-packages
'(
  (nox :location (recipe :fetcher github :repo "manateelazycat/nox"))
 )

lsp layer是不是要删除掉,python layer默认会加载cannaoda layer, 怎么处理

lsp layer 可以去掉,cannaoda layer 是啥,不需要的 package 可以放到 dotspacemacs-excluded-packages 或者像我这样在 layer 中加 not 去掉

   (c-c++ :packages (cc-mode ccls company-c-headers)
          :variables
          c-c++-default-mode-for-headers 'c++-mode
          c++-enable-organize-includes-on-save t
          ;; c-c++-backend t
          c-basic-offset 4
          c-c++-adopt-subprojects t)
   (python :packages (not yapfify live-py-mode)
           :variables
           python-backend 'anaconda
           python-sort-imports-on-save t
           python-test-runner '(pytest nose)
           python-formatter 'black
           python-format-on-save nil
           blacken-fast-unsafe t
           python-fill-column 88)
1 个赞

Hi, 我已经不用nox 而继续用lsp了。 在spacemacs 中,你想使用nox的话,你只需要把你想用lsp作为backend的语言那些layer中,backend 去掉lsp支持 改为默认的; 可以但不需要删除lsp (不删除的好处是,你可以随时关闭nox,随时用lsp)。如果python 你不想用默认的anaconda,你可以在进入python文件后,关闭anacoanda,有个具体的mode close,比较直接。 即使anaconda和nox一起开,应该问题也不大。

我不用nox的原因是,lsp现在速度已经比较快(没有觉得和nox有明显区别),在spacemacs 里面用起来也比较方便了。在识别根目录上,nox好像略有问题。

之前识别出现问题之后就没有补全了,现在不知道因为什么,会报错但是会出补全