Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor(lsp): remove unused code #9897

Merged
merged 1 commit into from
Mar 26, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 0 additions & 16 deletions cli/lsp/tsc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1339,8 +1339,6 @@ struct Response {
}

struct State<'a> {
#[allow(unused)]
asset: Option<String>,
last_id: usize,
response: Option<Response>,
state_snapshot: StateSnapshot,
Expand All @@ -1350,7 +1348,6 @@ struct State<'a> {
impl<'a> State<'a> {
fn new(state_snapshot: StateSnapshot) -> Self {
Self {
asset: None,
last_id: 1,
response: None,
state_snapshot,
Expand Down Expand Up @@ -1668,18 +1665,6 @@ fn script_version(
Ok(None)
}

#[derive(Debug, Deserialize)]
#[serde(rename_all = "camelCase")]
struct SetAssetArgs {
text: Option<String>,
}

#[allow(clippy::unnecessary_wraps)]
fn set_asset(state: &mut State, args: SetAssetArgs) -> Result<bool, AnyError> {
state.asset = args.text;
Ok(true)
}

/// Create and setup a JsRuntime based on a snapshot. It is expected that the
/// supplied snapshot is an isolate that contains the TypeScript language
/// server.
Expand All @@ -1703,7 +1688,6 @@ pub fn start(debug: bool) -> Result<JsRuntime, AnyError> {
runtime.register_op("op_respond", op(respond));
runtime.register_op("op_script_names", op(script_names));
runtime.register_op("op_script_version", op(script_version));
runtime.register_op("op_set_asset", op(set_asset));

let init_config = json!({ "debug": debug });
let init_src = format!("globalThis.serverInit({});", init_config);
Expand Down