-
Notifications
You must be signed in to change notification settings - Fork 12
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
token type is member #20
Comments
@backtolife2021 Hi just a quick question since I am trying to debug my own theme with this plugin: How did you extract the name of the token type at cursor position? |
I'm not sure whether this still works: nvim-treesitter/playground#57 probably not since a lot of things have changed since then (also the tree-sitter part has updated in this PR) |
The language servers can themselves decide what they return. They return mostly the standardized types but sometimes they return multiple tokens for the same thing. E.g. rust-analyzer has a dedicated token type for lifetimes. How did you print the token type with Neovim? |
I use the method mentioned in this comment to print the token type |
Sadly that only works with servers that support range tokens. |
@I-Want-ToBelieve in vscode "member" is deprecated and refers to "method". So you see "method" in vscode. |
VsCode classification for nvim: semantic_tokens.token_map.comment = "@comment"
semantic_tokens.token_map.string = "@string"
semantic_tokens.token_map.keyword = "@keyword"
semantic_tokens.token_map.number = "@number"
semantic_tokens.token_map.regexp = "@string.regex"
semantic_tokens.token_map.operator = "@keyword.operator"
semantic_tokens.token_map.namespace = "@namespace"
semantic_tokens.token_map.type = "@type"
semantic_tokens.token_map.class = "@type"
semantic_tokens.token_map.interface = "@type"
semantic_tokens.token_map.enum = "@type"
semantic_tokens.token_map.struct = "@structure"
semantic_tokens.token_map.typeParameter = "@type"
semantic_tokens.token_map["function"] = "@function"
semantic_tokens.token_map.member = "@method"
semantic_tokens.token_map.method = "@method"
semantic_tokens.token_map.macro = "@function.macro"
semantic_tokens.token_map.variable = "@variable"
semantic_tokens.token_map.parameter = "@parameter"
semantic_tokens.token_map.property = "@property"
semantic_tokens.token_map.enumMember = "@constant"
semantic_tokens.token_map.event = "@variable"
semantic_tokens.token_map.label = "@label"
semantic_tokens.token_map.decorator = "@attribute"
semantic_tokens.token_map.attribute = "@attribute"
semantic_tokens.modifiers_map.readonly = {
variable = "@constant",
property = "@constant",
}
semantic_tokens.modifiers_map.constant = {
variable = "@constant",
property = "@constant",
}
semantic_tokens.modifiers_map.defaultLibrary = {
typeAlias = "@type.builtin",
type = "@type.builtin",
class = "@type.builtin",
interface = "@type.builtin",
variable = "@type.builtin",
property = "@type.builtin",
enum = "@type.builtin",
["function"] = "@type.builtin",
method = "@type.builtin",
member = "@type.builtin",
} Rust extension: -- Rust: Style for builtin attributes
semantic_tokens.token_map.builtinAttribute = "@attribute"
-- Rust: Style for builtin types
semantic_tokens.token_map.builtinType = "@type.builtin"
-- Rust: Style for char escapes in strings
semantic_tokens.token_map.escapeSequence = "@string.escape"
-- Rust: Style for {} placeholders in format strings
semantic_tokens.token_map.formatSpecifier = "@operator"
-- Rust: Style for the self keyword
semantic_tokens.token_map.selfKeyword = "@keyword"
-- Rust: Style for the self type keyword
semantic_tokens.token_map.selfTypeKeyword = "@keyword"
-- Rust: Style for mutable locals and statics as well as functions
-- taking `&mut self`
semantic_tokens.modifiers_map.mutable = "@text.underline" |
Same for nvim 0.9 (without this plugin) https://gist.github.com/qRoC/288727caed4aa361ef5f15fa7852ca3e |
There is no such token type in the spec
vscode:
The text was updated successfully, but these errors were encountered: