-
Notifications
You must be signed in to change notification settings - Fork 5.4k
Fix function_cache
garbage collection bug
#6555
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
Merged
Merged
Changes from all commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
e296f87
Add VSCode launch configuration for debugging the Sway Language Serve…
JoshuaBatty acfdb23
add gc methods for clearing the function cache
JoshuaBatty 453e5af
remove gc_frequency option as we actually need to GC on each keystrok…
JoshuaBatty a61f3a1
add gc test for minimal scripts
JoshuaBatty 8a5ed05
Refactor QueryEngine to use CowCache for programs and function caches…
JoshuaBatty a40b441
fix typo
JoshuaBatty 41e4cf9
Add a commit method to QueryEngine to commit changes in all caches an…
JoshuaBatty 9c949d0
Merge branch 'master' into josh/fix_function_slab_gc
sdankel 7cc28ce
Merge branch 'master' into josh/fix_function_slab_gc
JoshuaBatty cddd31a
Merge branch 'master' into josh/fix_function_slab_gc
JoshuaBatty File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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,23 @@ | ||
// Configuration for debugging the Sway Language Server (forc-lsp) | ||
// Usage instructions: | ||
// 1. Ensure you've built forc-lsp with debug symbols: | ||
// cargo build -p forc-lsp | ||
// 2. Install the debug version: | ||
// cargo install --path ./forc-plugins/forc-lsp --debug | ||
// 3. Open your Sway project in a separate VSCode window (this starts forc-lsp) | ||
// 4. In the forc-lsp project window, set breakpoints in the code | ||
// 5. Go to Run and Debug view, select "Attach to forc-lsp", and start debugging | ||
// 6. When prompted, select the forc-lsp process | ||
// 7. Debug forc-lsp as it responds to actions in your Sway project | ||
{ | ||
"version": "0.2.0", | ||
"configurations": [ | ||
JoshuaBatty marked this conversation as resolved.
Show resolved
Hide resolved
|
||
{ | ||
"type": "lldb", | ||
"request": "attach", | ||
"name": "Attach to forc-lsp", | ||
"pid": "${command:pickProcess}", | ||
"program": "${env:HOME}/.cargo/bin/forc-lsp" | ||
} | ||
] | ||
} |
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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
2 changes: 2 additions & 0 deletions
2
sway-lsp/tests/fixtures/garbage_collection/minimal_script/.gitignore
This file contains hidden or 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,2 @@ | ||
out | ||
target |
8 changes: 8 additions & 0 deletions
8
sway-lsp/tests/fixtures/garbage_collection/minimal_script/Forc.toml
This file contains hidden or 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,8 @@ | ||
[project] | ||
authors = ["Fuel Labs <contact@fuel.sh>"] | ||
entry = "main.sw" | ||
license = "Apache-2.0" | ||
name = "minimal_script" | ||
implicit-std = false | ||
|
||
[dependencies] |
14 changes: 14 additions & 0 deletions
14
sway-lsp/tests/fixtures/garbage_collection/minimal_script/src/main.sw
This file contains hidden or 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,14 @@ | ||
script; | ||
|
||
struct MyStruct { | ||
field1: u16, | ||
} | ||
|
||
fn func(s: MyStruct) -> u16 { | ||
s.field1 | ||
} | ||
|
||
fn main() { | ||
let x = MyStruct { field1: 10 }; | ||
let y = func(x); | ||
} |
This file contains hidden or 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
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.