Skip to content

Commit

Permalink
fix cargo clippy error
Browse files Browse the repository at this point in the history
Signed-off-by: he1pa <18012015693@163.com>
  • Loading branch information
He1pa committed Dec 28, 2023
1 parent 3caa874 commit d79db3c
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions kclvm/tools/src/LSP/src/semantic_token.rs
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ pub(crate) fn semantic_tokens_full(file: &str, gs: &GlobalState) -> Option<Seman
}))
}

pub fn kcl_semantic_tokens_to_semantic_tokens(
pub(crate) fn kcl_semantic_tokens_to_semantic_tokens(
tokens: &mut Vec<KCLSemanticToken>,
) -> Vec<SemanticToken> {
tokens.sort_by(|a, b| {
Expand All @@ -93,8 +93,8 @@ pub fn kcl_semantic_tokens_to_semantic_tokens(
.iter()
.map(|obj| {
// ref: https://github.com/microsoft/vscode-extension-samples/blob/5ae1f7787122812dcc84e37427ca90af5ee09f14/semantic-tokens-sample/vscode.proposed.d.ts#L71
//A file can contain many tokens, perhaps even hundreds of thousands of tokens. Therefore, to improve
//the memory consumption around describing semantic tokens, we have decided to avoid allocating an object
// A file can contain many tokens, perhaps even hundreds of thousands of tokens. Therefore, to improve
// the memory consumption around describing semantic tokens, we have decided to avoid allocating an object
// for each token and we represent tokens from a file as an array of integers. Furthermore, the position
// of each token is expressed relative to the token before it because most tokens remain stable relative to
// each other when edits are made in a file.
Expand Down

0 comments on commit d79db3c

Please sign in to comment.