forked from FuelLabs/sway
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
…uelLabs#1179) * Move `forc`'s LSP support into a dedicated `forc-lsp` plugin crate. This creates a dedicated `forc-lsp` plugin crate. With `forc`'s new plugin support, having this plugin installed and available via `PATH` enables the original behaviour of starting the sway language server via `forc lsp <args>`. This also acts as a local test for `forc` plugin support and as a simple example of how to implement a `forc` plugin. The old `lsp` and `forc_lsp` modules have been removed from `forc` in favour of this new `forc-lsp` plugin. * Add forc-lsp plugin to CI git tag version check * forc-lsp: sync to current `forc` version at 0.9.2 * fuel-lsp: Use `major.minor` for dep versions * forc-lsp: local deps must be major.minor.patch for publishing
- Loading branch information
1 parent
c70240a
commit a121a43
Showing
11 changed files
with
56 additions
and
41 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
[package] | ||
name = "forc-lsp" | ||
version = "0.9.2" | ||
authors = ["Fuel Labs <[email protected]>"] | ||
edition = "2021" | ||
homepage = "https://fuel.network/" | ||
license = "Apache-2.0" | ||
repository = "https://github.com/FuelLabs/sway" | ||
description = "A simple `forc` plugin for starting the sway language server." | ||
|
||
[dependencies] | ||
anyhow = "1" | ||
clap = { version = "3", features = ["derive"] } | ||
sway-lsp = { version = "0.9.2", path = "../sway-lsp" } | ||
tokio = { version = "1.8" } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
//! A simple `forc` plugin for starting the sway language server. | ||
//! | ||
//! Once installed and available via `PATH`, can be executed via `forc lsp`. | ||
use clap::Parser; | ||
|
||
#[derive(Debug, Parser)] | ||
#[clap( | ||
name = "forc-lsp", | ||
about = "Forc plugin for the Sway LSP (Language Server Protocol) implementation.", | ||
version | ||
)] | ||
pub struct App { | ||
/// Instructs the client to draw squiggly lines under all of the tokens that our server managed | ||
/// to parse. | ||
#[clap(long)] | ||
pub parsed_tokens_as_warnings: bool, | ||
} | ||
|
||
#[tokio::main] | ||
async fn main() { | ||
let app = App::parse(); | ||
let dbg = sway_lsp::utils::debug::DebugFlags { | ||
parsed_tokens_as_warnings: app.parsed_tokens_as_warnings, | ||
}; | ||
sway_lsp::start(dbg).await | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters