mirror of
https://github.com/roc-lang/roc.git
synced 2025-10-01 15:51:12 +00:00
Drop and mark unused symbols
This commit is contained in:
parent
f3cfd07ad8
commit
ac179b5fdc
3 changed files with 9 additions and 9 deletions
|
@ -79,7 +79,6 @@ impl GlobalAnalysis {
|
|||
let mut documents = vec![];
|
||||
|
||||
let LoadedModule {
|
||||
module_id,
|
||||
interns,
|
||||
mut can_problems,
|
||||
mut type_problems,
|
||||
|
@ -92,7 +91,6 @@ impl GlobalAnalysis {
|
|||
} = module;
|
||||
|
||||
let mut root_module = Some(RootModule {
|
||||
module_id,
|
||||
subs: solved.into_inner(),
|
||||
abilities_store,
|
||||
});
|
||||
|
@ -151,7 +149,6 @@ fn path_to_url(path: &Path) -> Url {
|
|||
}
|
||||
|
||||
struct RootModule {
|
||||
module_id: ModuleId,
|
||||
subs: Subs,
|
||||
abilities_store: AbilitiesStore,
|
||||
}
|
||||
|
@ -275,10 +272,6 @@ impl AnalyzedDocument {
|
|||
&self.url
|
||||
}
|
||||
|
||||
pub fn module_id(&self) -> Option<ModuleId> {
|
||||
self.module.as_ref().map(|m| m.module_id)
|
||||
}
|
||||
|
||||
fn line_info(&self) -> &LineInfo {
|
||||
&self.line_info
|
||||
}
|
||||
|
|
|
@ -3,6 +3,8 @@ use tower_lsp::lsp_types::SemanticToken;
|
|||
|
||||
use super::tokens::Token;
|
||||
|
||||
/// Encodes semantic tokens as described in the LSP specification.
|
||||
/// See [the sample documentation](https://github.com/microsoft/vscode-extension-samples/blob/5ae1f7787122812dcc84e37427ca90af5ee09f14/semantic-tokens-sample/vscode.proposed.d.ts#L71-L128).
|
||||
pub fn arrange_semantic_tokens(
|
||||
tokens: impl IntoIterator<Item = Loc<Token>>,
|
||||
line_info: &LineInfo,
|
||||
|
|
|
@ -21,9 +21,12 @@ use roc_region::all::{Loc, Region};
|
|||
use tower_lsp::lsp_types::SemanticTokenType;
|
||||
|
||||
macro_rules! tokens {
|
||||
($($token:ident => $lsp_token:literal),* $(,)?) => {
|
||||
($($(#[$meta:meta])* $token:ident => $lsp_token:literal),* $(,)?) => {
|
||||
pub enum Token {
|
||||
$($token),*
|
||||
$(
|
||||
$(#[$meta])*
|
||||
$token
|
||||
),*
|
||||
}
|
||||
|
||||
fn _non_redundant_lsp_tokens() {
|
||||
|
@ -47,7 +50,9 @@ tokens! {
|
|||
Module => "namespace",
|
||||
Type => "type",
|
||||
Ability => "interface",
|
||||
#[allow(unused)]
|
||||
TypeVariable => "typeParameter",
|
||||
#[allow(unused)]
|
||||
Parameter => "parameter",
|
||||
Variable => "variable",
|
||||
Field => "property",
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue