Giter Site home page Giter Site logo

Comments (8)

manateelazycat avatar manateelazycat commented on July 21, 2024

lsp-bridge-semantic-tokens-mode 选项打开了吗?

我自己平常也不用 semantic

from lsp-bridge.

zijianyue avatar zijianyue commented on July 21, 2024

打开了

from lsp-bridge.

manateelazycat avatar manateelazycat commented on July 21, 2024

发一下测试代码和全部日志吧, 估计要5.1以后才有时间了。

from lsp-bridge.

zijianyue avatar zijianyue commented on July 21, 2024

main.cpp

#include <iostream>
#include <cmath>

struct Point {
    double x, y;
    Point(double x_, double y_) : x(x_), y(y_) {}

};
double distance(const Point& p1, const Point& p2) {
    double dx = p1.x - p2.x;
    double dy = p1.y - p2.y;
    return std::sqrt(dx * dx + dy * dy);
}
int main() {
    auto p1 = Point(1,2);
    auto p2 = Point(3,4);
    auto ret = distance(p1, p2);
    std::cout << "ret :" << ret << std::endl;
    ret = distance(p2, p1);
    std::cout << "ret2 :" << ret << std::endl;

    return 0;
}

from lsp-bridge.

manateelazycat avatar manateelazycat commented on July 21, 2024

@xhcoding 大佬能帮忙看一下吗? 我看了一下日志, LSP Server 都返回了Tokens信息, 但是 get_faces_index 总是返回 None, 导致 render_tokens.add 这行代码没执行。

from lsp-bridge.

xhcoding avatar xhcoding commented on July 21, 2024

lsp-bridge-semantic-tokens-mode 高亮需要根据文档自己配置,默认只会高亮宏关闭:https://github.com/manateelazycat/lsp-bridge/wiki/Semantic-Tokens-%5B%E7%AE%80%E4%BD%93%E4%B8%AD%E6%96%87%5D

比如函数高亮成红色,类高亮成橘色, namespace 高亮成绿色:

    (defface lsp-bridge-semantic-tokens-function-face
    '((t :foreground "red"))
    "Face used for globalScope token."
    :group 'lsp-bridge-semantic-tokens)

  (defface lsp-bridge-semantic-tokens-class-face
    '((t :foreground "orange"))
    "Face used for globalScope token."
    :group 'lsp-bridge-semantic-tokens)

  (defface lsp-bridge-semantic-tokens-namespace-face
    '((t :foreground "green"))
    "Face used for globalScope token."
    :group 'lsp-bridge-semantic-tokens)

  (setq-default lsp-bridge-semantic-tokens-type-faces
                [("function" . lsp-bridge-semantic-tokens-function-face)
                 ("class" . lsp-bridge-semantic-tokens-class-face)
                 ("namespace" . lsp-bridge-semantic-tokens-namespace-face)
                 ])

  (setq-default lsp-bridge-semantic-tokens-ignore-modifier-limit-types ["function" "class" "namespace"])

image

from lsp-bridge.

manateelazycat avatar manateelazycat commented on July 21, 2024

感谢 @xhcoding 大佬解惑, @zijianyue 我按照Wiki测试的写了配置以后就可以正常工作了。

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.