Fix a bunch of warnings
This commit is contained in:
		
							parent
							
								
									1d0fd9dd0a
								
							
						
					
					
						commit
						77107ef95e
					
				| @ -3,8 +3,6 @@ | ||||
| 
 | ||||
| use std::{cell::RefCell, rc::Rc}; | ||||
| 
 | ||||
| use llvm_sys::core::LLVMBuildIsNull; | ||||
| 
 | ||||
| use crate::{ | ||||
|     Block, BlockData, CompileResult, ConstValueKind, CustomTypeKind, ErrorKind, FunctionData, Instr, InstructionData, | ||||
|     ModuleData, NamedStruct, TerminatorKind, Type, TypeCategory, TypeData, | ||||
|  | ||||
| @ -2,16 +2,15 @@ use std::{collections::HashMap, hash::Hash, path::PathBuf}; | ||||
| 
 | ||||
| use reid::{ | ||||
|     ast::{ | ||||
|         ReturnType, | ||||
|         lexer::{FullToken, Token}, | ||||
|         token_stream::TokenRange, | ||||
|     }, | ||||
|     codegen::intrinsics::{self, get_intrinsic_assoc_functions}, | ||||
|     codegen::intrinsics::get_intrinsic_assoc_functions, | ||||
|     compile_module, | ||||
|     error_raporting::{ErrorModules, ReidError}, | ||||
|     mir::{ | ||||
|         self, Context, CustomTypeKey, FunctionCall, FunctionDefinitionKind, FunctionParam, IfExpression, Metadata, | ||||
|         SourceModuleId, StructType, TypeKind, WhileStatement, typecheck::typerefs::TypeRefs, | ||||
|         self, Context, CustomTypeKey, FunctionCall, FunctionParam, IfExpression, Metadata, SourceModuleId, StructType, | ||||
|         TypeKind, WhileStatement, typecheck::typerefs::TypeRefs, | ||||
|     }, | ||||
|     perform_all_passes, | ||||
| }; | ||||
| @ -200,26 +199,6 @@ impl AnalysisState { | ||||
|         } | ||||
|     } | ||||
| 
 | ||||
|     pub fn set_documentation(&mut self, token_idx: usize, documentation: Option<String>) { | ||||
|         if let Some(documentation) = documentation { | ||||
|             if let Some(token) = self.map.get_mut(&token_idx) { | ||||
|                 token.hover.documentation = Some(documentation); | ||||
|             } else { | ||||
|                 self.map.insert( | ||||
|                     token_idx, | ||||
|                     SemanticToken { | ||||
|                         hover: Hover { | ||||
|                             documentation: Some(documentation), | ||||
|                             kind: None, | ||||
|                         }, | ||||
|                         autocomplete: Vec::new(), | ||||
|                         symbol: Default::default(), | ||||
|                     }, | ||||
|                 ); | ||||
|             } | ||||
|         } | ||||
|     } | ||||
| 
 | ||||
|     pub fn set_symbol(&mut self, idx: usize, symbol: SymbolId) { | ||||
|         self.symbol_to_token.insert(symbol, idx); | ||||
|         if let Some(token) = self.map.get_mut(&idx) { | ||||
| @ -717,7 +696,7 @@ pub fn analyze_context( | ||||
| 
 | ||||
|         let mut inner_scope = scope.inner(); | ||||
| 
 | ||||
|         analyze_function_parameters(context, module, function, &mut inner_scope); | ||||
|         analyze_function_parameters(module, function, &mut inner_scope); | ||||
| 
 | ||||
|         match &function.kind { | ||||
|             mir::FunctionDefinitionKind::Local(block, _) => analyze_block(context, module, block, &mut inner_scope), | ||||
| @ -779,7 +758,7 @@ pub fn analyze_context( | ||||
| 
 | ||||
|         let mut inner_scope = scope.inner(); | ||||
| 
 | ||||
|         analyze_function_parameters(context, module, function, &mut inner_scope); | ||||
|         analyze_function_parameters(module, function, &mut inner_scope); | ||||
| 
 | ||||
|         match &function.kind { | ||||
|             mir::FunctionDefinitionKind::Local(block, _) => analyze_block(context, module, block, &mut inner_scope), | ||||
| @ -872,7 +851,6 @@ pub fn analyze_context( | ||||
| } | ||||
| 
 | ||||
| pub fn analyze_function_parameters( | ||||
|     context: &mir::Context, | ||||
|     module: &mir::Module, | ||||
|     function: &mir::FunctionDefinition, | ||||
|     scope: &mut AnalysisScope, | ||||
|  | ||||
| @ -9,15 +9,15 @@ use reid::parse_module; | ||||
| use serde::{Deserialize, Serialize}; | ||||
| use tokio::sync::Mutex; | ||||
| use tower_lsp::lsp_types::{ | ||||
|     self, CompletionItem, CompletionItemKind, CompletionOptions, CompletionParams, CompletionResponse, Diagnostic, | ||||
|     DiagnosticSeverity, DidChangeTextDocumentParams, DidOpenTextDocumentParams, DidSaveTextDocumentParams, | ||||
|     DocumentFilter, GotoDefinitionParams, GotoDefinitionResponse, Hover, HoverContents, HoverParams, | ||||
|     HoverProviderCapability, InitializeParams, InitializeResult, InitializedParams, Location, MarkedString, | ||||
|     MarkupContent, MarkupKind, MessageType, OneOf, Range, ReferenceParams, RenameParams, SemanticToken, | ||||
|     SemanticTokensLegend, SemanticTokensOptions, SemanticTokensParams, SemanticTokensResult, | ||||
|     SemanticTokensServerCapabilities, ServerCapabilities, TextDocumentItem, TextDocumentRegistrationOptions, | ||||
|     TextDocumentSyncCapability, TextDocumentSyncKind, TextDocumentSyncOptions, TextDocumentSyncSaveOptions, TextEdit, | ||||
|     Url, WorkspaceEdit, WorkspaceFoldersServerCapabilities, WorkspaceServerCapabilities, | ||||
|     self, CompletionItem, CompletionOptions, CompletionParams, CompletionResponse, Diagnostic, DiagnosticSeverity, | ||||
|     DidChangeTextDocumentParams, DidOpenTextDocumentParams, DidSaveTextDocumentParams, DocumentFilter, | ||||
|     GotoDefinitionParams, GotoDefinitionResponse, Hover, HoverContents, HoverParams, HoverProviderCapability, | ||||
|     InitializeParams, InitializeResult, InitializedParams, Location, MarkedString, MarkupContent, MarkupKind, | ||||
|     MessageType, OneOf, Range, ReferenceParams, RenameParams, SemanticToken, SemanticTokensLegend, | ||||
|     SemanticTokensOptions, SemanticTokensParams, SemanticTokensResult, SemanticTokensServerCapabilities, | ||||
|     ServerCapabilities, TextDocumentItem, TextDocumentRegistrationOptions, TextDocumentSyncCapability, | ||||
|     TextDocumentSyncKind, TextDocumentSyncOptions, TextDocumentSyncSaveOptions, TextEdit, Url, WorkspaceEdit, | ||||
|     WorkspaceFoldersServerCapabilities, WorkspaceServerCapabilities, | ||||
| }; | ||||
| use tower_lsp::{Client, LanguageServer, LspService, Server, jsonrpc}; | ||||
| 
 | ||||
| @ -65,7 +65,7 @@ impl LanguageServer for Backend { | ||||
|                 completion_item: Some(lsp_types::CompletionOptionsCompletionItem { | ||||
|                     label_details_support: Some(true), | ||||
|                 }), | ||||
|                 resolve_provider: Some(true), | ||||
|                 resolve_provider: Some(false), | ||||
|                 work_done_progress_options: lsp_types::WorkDoneProgressOptions { | ||||
|                     work_done_progress: Some(true), | ||||
|                 }, | ||||
| @ -172,20 +172,6 @@ impl LanguageServer for Backend { | ||||
|         Ok(Some(CompletionResponse::Array(list))) | ||||
|     } | ||||
| 
 | ||||
|     async fn completion_resolve(&self, params: CompletionItem) -> jsonrpc::Result<CompletionItem> { | ||||
|         let data: Option<CompletionData> = if let Some(data) = ¶ms.data { | ||||
|             serde_json::from_value(data.clone()).ok() | ||||
|         } else { | ||||
|             None | ||||
|         }; | ||||
|         if let Some(data) = data { | ||||
|             let analysis = self.analysis.get(&data.path).unwrap(); | ||||
|             let token = analysis.tokens.get(data.token_idx).unwrap(); | ||||
|             if let Some(token_analysis) = analysis.state.map.get(&data.token_idx) {} | ||||
|         } | ||||
|         Ok(params) | ||||
|     } | ||||
| 
 | ||||
|     async fn hover(&self, params: HoverParams) -> jsonrpc::Result<Option<Hover>> { | ||||
|         let path = PathBuf::from(params.text_document_position_params.text_document.uri.path()); | ||||
|         let analysis = self.analysis.get(&path); | ||||
|  | ||||
		Loading…
	
		Reference in New Issue
	
	Block a user