mirror of
https://github.com/astral-sh/ruff.git
synced 2025-09-29 13:24:57 +00:00
[ty] Fix server version (#19284)
This commit is contained in:
parent
3cbf2fe82e
commit
3da8b51dc1
8 changed files with 54 additions and 23 deletions
|
@ -17,10 +17,6 @@ pub(crate) const DIAGNOSTIC_NAME: &str = "ty";
|
|||
/// result type is needed.
|
||||
pub(crate) type Result<T> = anyhow::Result<T>;
|
||||
|
||||
pub(crate) fn version() -> &'static str {
|
||||
env!("CARGO_PKG_VERSION")
|
||||
}
|
||||
|
||||
pub fn run_server() -> anyhow::Result<()> {
|
||||
let four = NonZeroUsize::new(4).unwrap();
|
||||
|
||||
|
|
|
@ -57,12 +57,10 @@ impl Server {
|
|||
let server_capabilities =
|
||||
Self::server_capabilities(position_encoding, global_options.diagnostic_mode());
|
||||
|
||||
let connection = connection.initialize_finish(
|
||||
id,
|
||||
&server_capabilities,
|
||||
crate::SERVER_NAME,
|
||||
crate::version(),
|
||||
)?;
|
||||
let version = ruff_db::program_version().unwrap_or("Unknown");
|
||||
|
||||
let connection =
|
||||
connection.initialize_finish(id, &server_capabilities, crate::SERVER_NAME, version)?;
|
||||
|
||||
// The number 32 was chosen arbitrarily. The main goal was to have enough capacity to queue
|
||||
// some responses before blocking.
|
||||
|
@ -74,6 +72,8 @@ impl Server {
|
|||
global_options.tracing.log_file.as_deref(),
|
||||
);
|
||||
|
||||
tracing::debug!("Version: {version}");
|
||||
|
||||
let mut workspace_for_url = |url: Url| {
|
||||
let Some(workspace_settings) = workspace_options.as_mut() else {
|
||||
return (url, ClientOptions::default());
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue