Giter Site home page Giter Site logo

Comments (7)

manateelazycat avatar manateelazycat commented on June 26, 2024

给测试代码吧

from lsp-bridge.

bbenchen avatar bbenchen commented on June 26, 2024

mybatis-flex

输入Clone后,返回结果如下:

image

from lsp-bridge.

bbenchen avatar bbenchen commented on June 26, 2024

我将 lsp-bridge-workspace--list-symbols 中 find-file 处代码修改成下面的代码,jdtls 给出的提示是:[LSP-Bridge] No definition found.

(cond ((string-prefix-p "jdt://" symbol-file)
       (lsp-bridge-call-file-api "jdt_uri_resolver" symbol-file symbol-position))
      (t
       (find-file symbol-file)
       (goto-char (acm-backend-lsp-position-to-point symbol-position))))

from lsp-bridge.

bbenchen avatar bbenchen commented on June 26, 2024

在执行 lsp-bridge-call-file-api 时,使用 url-encode-url 函数将 symbol-file 转义处理一下,就可以正常跳转了
lsp-bridge-workspace--list-symbols 最终代码以下:

(defun lsp-bridge-workspace--list-symbols (info)
  (if (zerop (length info))
      (message "LSP server did not return any symbols.")
    (let* ((symbols (mapcar #'lsp-bridge-workspace-transform-info info))
           (match-symbol (completing-read "Workspace symbol: " symbols))
           (match-info (seq-filter (lambda (i) (string-equal match-symbol (lsp-bridge-workspace-transform-info i))) info)))
      (when match-info
        (let* ((symbol-info (plist-get (car match-info) :location))
               (symbol-file (lsp-bridge-pick-file-path (format "%s" (plist-get symbol-info :uri))))
               (symbol-position (plist-get (plist-get symbol-info :range) :start)))
          (cond ((string-prefix-p "jdt://" symbol-file)
                 (lsp-bridge-call-file-api "jdt_uri_resolver" (url-encode-url symbol-file) symbol-position))
                (t
                 (find-file symbol-file)
                 (goto-char (acm-backend-lsp-position-to-point symbol-position)))))))))

from lsp-bridge.

manateelazycat avatar manateelazycat commented on June 26, 2024

发个补丁吧,谢谢

from lsp-bridge.

bbenchen avatar bbenchen commented on June 26, 2024

@manateelazycat OK

from lsp-bridge.

manateelazycat avatar manateelazycat commented on June 26, 2024

d9c976c

这个补丁已经修复了。

from lsp-bridge.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.