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

Remove the option for an external formatter in nls #2064

Merged
merged 1 commit into from
Oct 9, 2024
Merged
Show file tree
Hide file tree
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
6 changes: 1 addition & 5 deletions lsp/nls/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,6 @@ version.workspace = true
name = "nls"
path = "src/main.rs"

[features]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure we want to remove the format feature though. I think the rationale around features right now is to leave the possibility to build a minimal nickel interpreter that can be embedded say on a server, which doesn't need to format, render markdown, etc. - so anything that isn't strictly necessary and pulls in a non trivial set of dependencies is probably better kept behind a feature gate.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is just the nls format feature, though. Is there a need for a minimal nls?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, you're right, my bad.

default = ["format"]
format = ["nickel-lang-core/format"]

[[bench]]
name = "main"
harness = false
Expand Down Expand Up @@ -45,7 +41,7 @@ lsp-types.workspace = true
# contract they should follow, e.g. with an environment variable or just the
# filesystem layout, in which case we will be able to show Nickel diagnostics
# directly inside a TOML or a YAML file. It's not used as of yet, though.
nickel-lang-core = {workspace = true, default-features = false, features = ["spanned-deser"]}
nickel-lang-core = {workspace = true, default-features = false, features = ["spanned-deser", "format"]}
regex.workspace = true
scopeguard.workspace = true
serde = { workspace = true, features = ["derive"] }
Expand Down
77 changes: 0 additions & 77 deletions lsp/nls/src/requests/formatting_external.rs

This file was deleted.

8 changes: 1 addition & 7 deletions lsp/nls/src/requests/mod.rs
Original file line number Diff line number Diff line change
@@ -1,12 +1,6 @@
pub mod completion;
pub mod formatting;
pub mod goto;
pub mod hover;
pub mod rename;
pub mod symbols;

#[cfg(feature = "format")]
pub mod formatting;

#[cfg(not(feature = "format"))]
#[path = "formatting_external.rs"]
pub mod formatting;