Skip to content

Commit

Permalink
Fix maxTsServerMemory (#17758)
Browse files Browse the repository at this point in the history
Release Notes:

- N/A

---------

Co-authored-by: Thorsten Ball <mrnugget@gmail.com>
  • Loading branch information
ConradIrwin and mrnugget authored Sep 12, 2024
1 parent 02d5f32 commit b341079
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 5 deletions.
19 changes: 15 additions & 4 deletions crates/languages/src/vtsls.rs
Original file line number Diff line number Diff line change
Expand Up @@ -222,9 +222,6 @@ impl LspAdapter for VtslsLspAdapter {
"suggest": {
"completeFunctionCalls": true
},
"tsserver": {
"maxTsServerMemory": 8092
},
"inlayHints": {
"parameterNames": {
"enabled": "all",
Expand Down Expand Up @@ -273,7 +270,21 @@ impl LspAdapter for VtslsLspAdapter {
language_server_settings(delegate.as_ref(), SERVER_NAME, cx)
.and_then(|s| s.settings.clone())
})?;
Ok(override_options.unwrap_or_default())

if let Some(options) = override_options {
return Ok(options);
}

let config = serde_json::json!({
"tsserver": {
"maxTsServerMemory": 8092
},
});

Ok(serde_json::json!({
"typescript": config,
"javascript": config
}))
}

fn language_ids(&self) -> HashMap<String, String> {
Expand Down
2 changes: 1 addition & 1 deletion docs/src/languages/typescript.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ Prettier will also be used for TypeScript files by default. To disable this:
{
"lsp": {
"vtsls": {
"initialization_options": {
"settings": {
// For TypeScript:
"typescript": { "tsserver": { "maxTsServerMemory": 16184 } },
// For JavaScript:
Expand Down

0 comments on commit b341079

Please sign in to comment.