Skip to content

Commit

Permalink
Update lockfile (FuelLabs#493)
Browse files Browse the repository at this point in the history
* Update lockfile.

* Fix API break in lsp-types (dep of lspower).

* Bump version to v0.1.2.

* Bump version.

* Remove warnings.
  • Loading branch information
adlerjohn authored Dec 25, 2021
1 parent 8a37329 commit 2431af7
Show file tree
Hide file tree
Showing 16 changed files with 233 additions and 255 deletions.
396 changes: 186 additions & 210 deletions Cargo.lock

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docstrings/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "docstrings"
version = "0.1.1"
version = "0.1.2"
edition = "2021"
publish = false

Expand Down
12 changes: 6 additions & 6 deletions forc/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "forc"
version = "0.1.1"
version = "0.1.2"
authors = ["Fuel Labs <[email protected]>"]
edition = "2018"
homepage = "https://fuel.network/"
Expand Down Expand Up @@ -28,11 +28,11 @@ serde = {version = "1.0", features = ["derive"]}
serde_json = "*"
source-span = "2.4"
structopt = "0.3"
sway-core = { version = "0.1.1", path = "../sway-core" }
sway-fmt = { version = "0.1.1", path = "../sway-fmt" }
sway-server = { version = "0.1.1", path = "../sway-server" }
sway-utils = { version = "0.1.1", path = "../sway-utils" }
sway-types = { version = "0.1.1", path = "../sway-types" }
sway-core = { version = "0.1.2", path = "../sway-core" }
sway-fmt = { version = "0.1.2", path = "../sway-fmt" }
sway-server = { version = "0.1.2", path = "../sway-server" }
sway-utils = { version = "0.1.2", path = "../sway-utils" }
sway-types = { version = "0.1.2", path = "../sway-types" }
tar = "0.4.35"
term-table = "1.3"
termcolor = "1.1"
Expand Down
2 changes: 1 addition & 1 deletion parser/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "parser"
version = "0.1.1"
version = "0.1.2"
edition = "2021"
publish = false

Expand Down
4 changes: 2 additions & 2 deletions sway-core/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "sway-core"
version = "0.1.1"
version = "0.1.2"
authors = ["Fuel Labs <[email protected]>"]
edition = "2018"
homepage = "https://fuel.network/"
Expand All @@ -26,7 +26,7 @@ sha2 = "0.9"
smallvec = "1.7"
source-span = "2.4"
structopt = { version = "0.3", default-features = false, optional = true }
sway-types = { version = "0.1.1", path = "../sway-types" }
sway-types = { version = "0.1.2", path = "../sway-types" }
thiserror = "1.0"
uuid-b64 = "0.1"

Expand Down
4 changes: 2 additions & 2 deletions sway-fmt/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "sway-fmt"
version = "0.1.1"
version = "0.1.2"
authors = ["Fuel Labs <[email protected]>"]
edition = "2018"
homepage = "https://fuel.network/"
Expand All @@ -10,4 +10,4 @@ description = "Sway sway-fmt."

[dependencies]
ropey = "1.2"
sway-core = { version = "0.1.1", path = "../sway-core" }
sway-core = { version = "0.1.2", path = "../sway-core" }
8 changes: 4 additions & 4 deletions sway-server/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "sway-server"
version = "0.1.1"
version = "0.1.2"
authors = ["Fuel Labs <[email protected]>"]
edition = "2018"
homepage = "https://fuel.network/"
Expand All @@ -14,7 +14,7 @@ lspower = "1.0.0"
pest = { version = "3.0", package = "fuel-pest" }
ropey = "1.2"
serde_json = "1.0.60"
sway-core = { version = "0.1.1", path = "../sway-core" }
sway-fmt = { version = "0.1.1", path = "../sway-fmt" }
sway-utils = { version = "0.1.1", path = "../sway-utils" }
sway-core = { version = "0.1.2", path = "../sway-core" }
sway-fmt = { version = "0.1.2", path = "../sway-fmt" }
sway-utils = { version = "0.1.2", path = "../sway-utils" }
tokio = { version = "1.3", features = ["io-std", "io-util", "macros", "net", "rt-multi-thread", "sync", "time"] }
12 changes: 6 additions & 6 deletions sway-server/src/capabilities/completion.rs
Original file line number Diff line number Diff line change
Expand Up @@ -32,14 +32,14 @@ pub fn to_completion_items(tokens: &[Token]) -> Vec<CompletionItem> {

fn get_kind(token_type: &TokenType) -> Option<CompletionItemKind> {
match token_type {
TokenType::Enum => Some(CompletionItemKind::Enum),
TokenType::Enum => Some(CompletionItemKind::ENUM),
TokenType::FunctionDeclaration(_) | &TokenType::FunctionApplication => {
Some(CompletionItemKind::Function)
Some(CompletionItemKind::FUNCTION)
}
TokenType::Library => Some(CompletionItemKind::Module),
TokenType::Struct(_) => Some(CompletionItemKind::Struct),
TokenType::Variable(_) => Some(CompletionItemKind::Variable),
TokenType::Trait(_) => Some(CompletionItemKind::Interface),
TokenType::Library => Some(CompletionItemKind::MODULE),
TokenType::Struct(_) => Some(CompletionItemKind::STRUCT),
TokenType::Variable(_) => Some(CompletionItemKind::VARIABLE),
TokenType::Trait(_) => Some(CompletionItemKind::INTERFACE),
_ => None,
}
}
4 changes: 2 additions & 2 deletions sway-server/src/capabilities/diagnostic.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ pub fn get_diagnostics(
let range = get_range(&WarningOrError::Error(error));
Diagnostic {
range,
severity: Some(DiagnosticSeverity::Error),
severity: Some(DiagnosticSeverity::ERROR),
message: error.to_friendly_error_string(),
..Default::default()
}
Expand All @@ -26,7 +26,7 @@ pub fn get_diagnostics(
let range = get_range(&WarningOrError::Warning(warning));
Diagnostic {
range,
severity: Some(DiagnosticSeverity::Warning),
severity: Some(DiagnosticSeverity::WARNING),
message: warning.to_friendly_warning_string(),
..Default::default()
}
Expand Down
14 changes: 7 additions & 7 deletions sway-server/src/capabilities/document_symbol.rs
Original file line number Diff line number Diff line change
Expand Up @@ -34,12 +34,12 @@ fn create_symbol_info(token: &Token, url: Url) -> SymbolInformation {

fn get_kind(token_type: &TokenType) -> SymbolKind {
match token_type {
TokenType::Enum => SymbolKind::Enum,
TokenType::FunctionDeclaration(_) | &TokenType::FunctionApplication => SymbolKind::Function,
TokenType::Library => SymbolKind::Module,
TokenType::Struct(_) => SymbolKind::Struct,
TokenType::Variable(_) => SymbolKind::Variable,
TokenType::Trait(_) => SymbolKind::Interface,
_ => SymbolKind::Unknown,
TokenType::Enum => SymbolKind::ENUM,
TokenType::FunctionDeclaration(_) | &TokenType::FunctionApplication => SymbolKind::FUNCTION,
TokenType::Library => SymbolKind::MODULE,
TokenType::Struct(_) => SymbolKind::STRUCT,
TokenType::Variable(_) => SymbolKind::VARIABLE,
TokenType::Trait(_) => SymbolKind::INTERFACE,
_ => SymbolKind::NULL, // TODO SymbolKind::UNKNOWN was removed in https://github.com/gluon-lang/lsp-types/pull/219
}
}
14 changes: 8 additions & 6 deletions sway-server/src/capabilities/file_sync.rs
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
use crate::core::session::Session;
use lspower::lsp::{FileChangeType, FileEvent};
use lspower::lsp::FileEvent;
use std::sync::Arc;

pub fn handle_watched_files(session: Arc<Session>, events: Vec<FileEvent>) {
for event in events {
if let FileChangeType::Deleted {} = event.typ {
let _ = session.remove_document(&event.uri);
}
pub fn handle_watched_files(_session: Arc<Session>, events: Vec<FileEvent>) {
for _event in events {
// FileChangeType::DELETED wants fully-qualified type, but that doesn't work
todo!();
// if let FileChangeType::DELETED {} = event.typ {
// let _ = session.remove_document(&event.uri);
// }
}
}
2 changes: 1 addition & 1 deletion sway-server/src/core/session.rs
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ impl Session {
}
}

pub fn remove_document(&self, url: &Url) -> Result<TextDocument, DocumentError> {
pub fn _remove_document(&self, url: &Url) -> Result<TextDocument, DocumentError> {
match self.documents.remove(url.path()) {
Some((_, text_document)) => Ok(text_document),
None => Err(DocumentError::DocumentNotFound),
Expand Down
6 changes: 3 additions & 3 deletions sway-server/src/server.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ impl Backend {
}

async fn log_info_message(&self, message: &str) {
self.client.log_message(MessageType::Info, message).await;
self.client.log_message(MessageType::INFO, message).await;
}

fn parse_and_store_sway_files(&self) -> Result<(), DocumentError> {
Expand Down Expand Up @@ -52,7 +52,7 @@ impl Backend {
impl LanguageServer for Backend {
async fn initialize(&self, _params: InitializeParams) -> jsonrpc::Result<InitializeResult> {
self.client
.log_message(MessageType::Info, "Initializing the Server")
.log_message(MessageType::INFO, "Initializing the Server")
.await;

// iterate over the project dir, parse all sway files
Expand All @@ -62,7 +62,7 @@ impl LanguageServer for Backend {
server_info: None,
capabilities: lsp::ServerCapabilities {
text_document_sync: Some(lsp::TextDocumentSyncCapability::Kind(
lsp::TextDocumentSyncKind::Incremental,
lsp::TextDocumentSyncKind::INCREMENTAL,
)),
definition_provider: Some(lsp::OneOf::Left(true)),
semantic_tokens_provider: capabilities::semantic_tokens::get_semantic_tokens(),
Expand Down
2 changes: 1 addition & 1 deletion sway-types/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "sway-types"
version = "0.1.1"
version = "0.1.2"
authors = ["Fuel Labs <[email protected]>"]
edition = "2018"
homepage = "https://fuel.network/"
Expand Down
2 changes: 1 addition & 1 deletion sway-utils/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "sway-utils"
version = "0.1.1"
version = "0.1.2"
authors = ["Fuel Labs <[email protected]>"]
edition = "2021"
homepage = "https://fuel.network/"
Expand Down
4 changes: 2 additions & 2 deletions test/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
[package]
name = "test"
version = "0.1.1"
version = "0.1.2"
authors = ["Fuel Labs <[email protected]>"]
edition = "2018"
publish = false

[dependencies]
forc = { version = "0.1.1", path = "../forc", features = ["test"], default-features = false }
forc = { version = "0.1.2", path = "../forc", features = ["test"], default-features = false }
fuel-asm = "0.1"
fuel-tx = "0.1"
fuel-vm = { version = "0.1", features = ["random"] }
Expand Down

0 comments on commit 2431af7

Please sign in to comment.