-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Rust analyzer is extremely heavyweight by default #9704
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
Comments
That sounds like the build cache is constantly being invalidated. Do you run cargo in the terminal too? Can you check if
Duplicate of #4712 |
I have this issue too and it has been exacerbated since the last two or three updates. After fixing errors (red squiggly lines), it can sometimes take > 10 seconds after they disappear which feels like forever. Any pointers on how to investigate this further and narrow down the issue? As of now, I have turned off rust autocomplete and only use native neovim error hints due to its heaviness. As a disclaimer, I'm not sure if it is solely a rust-analyzer issue or if it has to do with coc.vim since I use them together. |
I think I have the same problem in Sublime Text 4. It re-scans all dependencies after every keystroke. I've noticed it after upgrade to Rust 1.54, but I'm not sure if that's the cause. rust-analyzer 5983d37 2021-07-26 stable |
@kornelski that's.. quite surprising. But it sounds like a different issue, which I can't reproduce in Code or nvim. |
Can you get a LSP trace? If you run the editor under |
Ok, I've found the log panel. The log is truncated, because rust-analyzer logs more than LSP 1.7 wants to keep in the log:
|
Here's from a fresh project that has only one dependency: rust-analyzer: [DEBUG lsp_server::msg] < {"jsonrpc":"2.0","params":{"workspaceFolders":[{"name":"foo","uri":"file:///private/tmp/foo"}],"processId":96888,"rootUri":"file:///private/tmp/foo","capabilities":{"window":{"showDocument":{"support":true},"showMessage":{"messageActionItem":{"additionalPropertiesSupport":true}},"workDoneProgress":true},"general":{"regularExpressions":{"engine":"ECMAScript"},"markdown":{"parser":"Python-Markdown","version":"3.2.2"}},"textDocument":{"documentHighlight":{"dynamicRegistration":true},"rangeFormatting":{"dynamicRegistration":true},"hover":{"contentFormat":["markdown","plaintext"],"dynamicRegistration":true},"formatting":{"dynamicRegistration":true},"rename":{"prepareSupport":true,"dynamicRegistration":true},"synchronization":{"willSave":true,"didSave":true,"willSaveWaitUntil":true,"dynamicRegistration":true},"implementation":{"linkSupport":true,"dynamicRegistration":true},"codeAction":{"codeActionLiteralSupport":{"codeActionKind":{"valueSet":["quickfix","refactor","refactor.extract","refactor.inline","refactor.rewrite","source.organizeImports"]}},"resolveSupport":{"properties":["edit"]},"dataSupport":true,"dynamicRegistration":true},"signatureHelp":{"signatureInformation":{"documentationFormat":["markdown","plaintext"],"parameterInformation":{"labelOffsetSupport":true}},"dynamicRegistration":true},"definition":{"linkSupport":true,"dynamicRegistration":true},"declaration":{"linkSupport":true,"dynamicRegistration":true},"selectionRange":{"dynamicRegistration":true},"colorProvider":{"dynamicRegistration":true},"publishDiagnostics":{"codeDescriptionSupport":true,"tagSupport":{"valueSet":[2,1]},"relatedInformation":true,"dataSupport":true,"versionSupport":true},"completion":{"completionItem":{"documentationFormat":["markdown","plaintext"],"resolveSupport":{"properties":["detail","documentation","additionalTextEdits"]},"snippetSupport":true,"deprecatedSupport":true,"tagSupport":{"valueSet":[1]}},"completionItemKind":{"valueSet":[1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25]},"dynamicRegistration":true},"documentSymbol":{"hierarchicalDocumentSymbolSupport":true,"tagSupport":{"valueSet":[1]},"symbolKind":{"valueSet":[1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26]},"dynamicRegistration":true},"typeDefinition":{"linkSupport":true,"dynamicRegistration":true},"references":{"dynamicRegistration":true},"codeLens":{"dynamicRegistration":true}},"workspace":{"workspaceFolders":true,"workspaceEdit":{"documentChanges":true,"failureHandling":"abort"},"didChangeConfiguration":{"dynamicRegistration":true},"symbol":{"tagSupport":{"valueSet":[1]},"symbolKind":{"valueSet":[1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26]},"dynamicRegistration":true},"configuration":true,"executeCommand":{},"applyEdit":true}},"initializationOptions":{},"clientInfo":{"name":"Sublime Text LSP","version":"1.7.0"},"rootPath":"/private/tmp/foo"},"method":"initialize","id":1} rust-analyzer: [DEBUG lsp_server::msg] > {"jsonrpc":"2.0","id":1,"result":{"capabilities":{"textDocumentSync":{"openClose":true,"change":2,"save":{}},"selectionRangeProvider":true,"hoverProvider":true,"completionProvider":{"resolveProvider":true,"triggerCharacters":[":",".","'"]},"signatureHelpProvider":{"triggerCharacters":["(",","]},"definitionProvider":true,"typeDefinitionProvider":true,"implementationProvider":true,"referencesProvider":true,"documentHighlightProvider":true,"documentSymbolProvider":true,"workspaceSymbolProvider":true,"codeActionProvider":{"codeActionKinds":["","quickfix","refactor","refactor.extract","refactor.inline","refactor.rewrite"],"resolveProvider":true},"codeLensProvider":{"resolveProvider":true},"documentFormattingProvider":true,"documentRangeFormattingProvider":false,"documentOnTypeFormattingProvider":{"firstTriggerCharacter":"=","moreTriggerCharacter":[".",">","{"]},"renameProvider":{"prepareProvider":true},"foldingRangeProvider":true,"declarationProvider":true,"workspace":{"fileOperations":{"willRename":{"filters":[{"scheme":"file","pattern":{"glob":"**/*.rs","matches":"file"}},{"scheme":"file","pattern":{"glob":"**","matches":"folder"}}]}}},"callHierarchyProvider":true,"semanticTokensProvider":{"legend":{"tokenTypes":["comment","keyword","string","number","regexp","operator","namespace","type","struct","class","interface","enum","enumMember","typeParameter","function","method","property","macro","variable","parameter","angle","arithmetic","attribute","bitwise","boolean","brace","bracket","builtinAttribute","builtinType","character","colon","comma","comparison","constParameter","dot","escapeSequence","formatSpecifier","generic","label","lifetime","logical","operator","parenthesis","punctuation","selfKeyword","semicolon","typeAlias","union","unresolvedReference"],"tokenModifiers":["documentation","declaration","definition","static","abstract","deprecated","readonly","constant","controlFlow","injected","mutable","consuming","async","library","public","unsafe","attribute","trait","callable","intraDocLink"]},"range":true,"full":{"delta":true}},"experimental":{"joinLines":true,"ssr":true,"onEnter":true,"parentModule":true,"runnables":{"kinds":["cargo"]},"workspaceSymbolScopeKindFiltering":true}},"serverInfo":{"name":"rust-analyzer","version":"5983d3745 2021-07-26 stable"}}} rust-analyzer: [DEBUG lsp_server::msg] < {"jsonrpc":"2.0","params":{},"method":"initialized"} rust-analyzer: [DEBUG lsp_server::msg] > {"jsonrpc":"2.0","id":0,"method":"client/registerCapability","params":{"registrations":[{"id":"textDocument/didSave","method":"textDocument/didSave","registerOptions":{"includeText":false,"documentSelector":[{"pattern":"**/*.rs"},{"pattern":"**/Cargo.toml"},{"pattern":"**/Cargo.lock"}]}}]}} rust-analyzer: [DEBUG lsp_server::msg] > {"jsonrpc":"2.0","id":1,"method":"window/workDoneProgress/create","params":{"token":"rustAnalyzer/Fetching"}} rust-analyzer: [DEBUG lsp_server::msg] > {"jsonrpc":"2.0","method":"$/progress","params":{"token":"rustAnalyzer/Fetching","value":{"kind":"begin","title":"Fetching"}}} rust-analyzer: [DEBUG lsp_server::msg] < {"jsonrpc":"2.0","params":{"textDocument":{"text":"fn main() {\n println!(\"Hello, world!\");\n}\n","version":0,"uri":"file:///private/tmp/foo/foo/src/main.rs","languageId":"rust"}},"method":"textDocument/didOpen"} rust-analyzer: [DEBUG lsp_server::msg] < {"jsonrpc":"2.0","result":null,"id":0} rust-analyzer: [DEBUG lsp_server::msg] < {"jsonrpc":"2.0","result":null,"id":1} rust-analyzer: [DEBUG lsp_server::msg] > {"jsonrpc":"2.0","method":"$/progress","params":{"token":"rustAnalyzer/Fetching","value":{"kind":"report","message":"metadata"}}} rust-analyzer: [DEBUG lsp_server::msg] < {"jsonrpc":"2.0","params":{"textDocument":{"uri":"file:///private/tmp/foo/foo/src/main.rs"},"position":{"line":3,"character":0}},"method":"textDocument/documentHighlight","id":2} rust-analyzer: [DEBUG lsp_server::msg] > {"jsonrpc":"2.0","id":2,"error":{"code":-32801,"message":"waiting for cargo metadata or cargo check"}} rust-analyzer: [DEBUG lsp_server::msg] < {"jsonrpc":"2.0","params":{"range":{"start":{"line":3,"character":0},"end":{"line":3,"character":0}},"textDocument":{"uri":"file:///private/tmp/foo/foo/src/main.rs"},"context":{"diagnostics":[]}},"method":"textDocument/codeAction","id":3} rust-analyzer: [DEBUG lsp_server::msg] > {"jsonrpc":"2.0","id":3,"error":{"code":-32801,"message":"waiting for cargo metadata or cargo check"}} rust-analyzer: [DEBUG lsp_server::msg] < {"jsonrpc":"2.0","params":{"textDocument":{"uri":"file:///private/tmp/foo/foo/src/main.rs","version":1},"contentChanges":[{"rangeLength":0,"range":{"start":{"line":3,"character":0},"end":{"line":3,"character":0}},"text":" "}]},"method":"textDocument/didChange"} rust-analyzer: [DEBUG lsp_server::msg] < {"jsonrpc":"2.0","params":{"textDocument":{"uri":"file:///private/tmp/foo/foo/src/main.rs"},"position":{"line":3,"character":1}},"method":"textDocument/documentHighlight","id":4} rust-analyzer: [DEBUG lsp_server::msg] > {"jsonrpc":"2.0","id":4,"error":{"code":-32801,"message":"waiting for cargo metadata or cargo check"}} rust-analyzer: [DEBUG lsp_server::msg] > {"jsonrpc":"2.0","method":"$/progress","params":{"token":"rustAnalyzer/Fetching","value":{"kind":"end"}}} rust-analyzer: [DEBUG lsp_server::msg] > {"jsonrpc":"2.0","id":2,"method":"window/workDoneProgress/create","params":{"token":"rustAnalyzer/Roots Scanned"}} rust-analyzer: [DEBUG lsp_server::msg] > {"jsonrpc":"2.0","method":"$/progress","params":{"token":"rustAnalyzer/Roots Scanned","value":{"kind":"begin","title":"Roots Scanned","message":"0/12","percentage":0}}} rust-analyzer: [DEBUG lsp_server::msg] > {"jsonrpc":"2.0","method":"$/progress","params":{"token":"rustAnalyzer/Roots Scanned","value":{"kind":"report","message":"1/12","percentage":8}}} rust-analyzer: [DEBUG lsp_server::msg] > {"jsonrpc":"2.0","id":3,"method":"window/workDoneProgress/create","params":{"token":"rustAnalyzer/Fetching"}} rust-analyzer: [DEBUG lsp_server::msg] > {"jsonrpc":"2.0","method":"$/progress","params":{"token":"rustAnalyzer/Fetching","value":{"kind":"begin","title":"Fetching"}}} rust-analyzer: [DEBUG lsp_server::msg] > {"jsonrpc":"2.0","id":4,"method":"window/workDoneProgress/create","params":{"token":"rustAnalyzer/Loading"}} rust-analyzer: [DEBUG lsp_server::msg] > {"jsonrpc":"2.0","method":"$/progress","params":{"token":"rustAnalyzer/Loading","value":{"kind":"begin","title":"Loading"}}} rust-analyzer: [DEBUG lsp_server::msg] < {"jsonrpc":"2.0","result":null,"id":2} rust-analyzer: [DEBUG lsp_server::msg] < {"jsonrpc":"2.0","result":null,"id":3} rust-analyzer: [DEBUG lsp_server::msg] < {"jsonrpc":"2.0","result":null,"id":4} rust-analyzer: [DEBUG lsp_server::msg] > {"jsonrpc":"2.0","method":"$/progress","params":{"token":"rustAnalyzer/Roots Scanned","value":{"kind":"report","message":"2/12","percentage":16}}} rust-analyzer: [DEBUG lsp_server::msg] > {"jsonrpc":"2.0","method":"$/progress","params":{"token":"rustAnalyzer/Roots Scanned","value":{"kind":"report","message":"3/12","percentage":25}}} rust-analyzer: [DEBUG lsp_server::msg] > {"jsonrpc":"2.0","method":"$/progress","params":{"token":"rustAnalyzer/Roots Scanned","value":{"kind":"report","message":"4/12","percentage":33}}} rust-analyzer: [DEBUG lsp_server::msg] > {"jsonrpc":"2.0","method":"$/progress","params":{"token":"rustAnalyzer/Roots Scanned","value":{"kind":"report","message":"5/12","percentage":41}}} rust-analyzer: [DEBUG lsp_server::msg] > {"jsonrpc":"2.0","method":"$/progress","params":{"token":"rustAnalyzer/Roots Scanned","value":{"kind":"report","message":"6/12","percentage":50}}} rust-analyzer: [DEBUG lsp_server::msg] > {"jsonrpc":"2.0","method":"$/progress","params":{"token":"rustAnalyzer/Roots Scanned","value":{"kind":"report","message":"7/12","percentage":58}}} rust-analyzer: [DEBUG lsp_server::msg] > {"jsonrpc":"2.0","method":"$/progress","params":{"token":"rustAnalyzer/Roots Scanned","value":{"kind":"report","message":"8/12","percentage":66}}} rust-analyzer: [DEBUG lsp_server::msg] > {"jsonrpc":"2.0","method":"$/progress","params":{"token":"rustAnalyzer/Roots Scanned","value":{"kind":"report","message":"9/12","percentage":75}}} rust-analyzer: [DEBUG lsp_server::msg] > {"jsonrpc":"2.0","method":"$/progress","params":{"token":"rustAnalyzer/Roots Scanned","value":{"kind":"report","message":"10/12","percentage":83}}} rust-analyzer: [DEBUG lsp_server::msg] > {"jsonrpc":"2.0","method":"$/progress","params":{"token":"rustAnalyzer/Roots Scanned","value":{"kind":"report","message":"11/12","percentage":91}}} rust-analyzer: [DEBUG lsp_server::msg] > {"jsonrpc":"2.0","method":"$/progress","params":{"token":"rustAnalyzer/Roots Scanned","value":{"kind":"end","message":"12/12"}}} rust-analyzer: [DEBUG lsp_server::msg] > {"jsonrpc":"2.0","method":"$/progress","params":{"token":"rustAnalyzer/Fetching","value":{"kind":"report","message":"metadata"}}} rust-analyzer: [DEBUG lsp_server::msg] > {"jsonrpc":"2.0","method":"$/progress","params":{"token":"rustAnalyzer/Loading","value":{"kind":"report","message":"metadata foo"}}} rust-analyzer: [DEBUG lsp_server::msg] > {"jsonrpc":"2.0","method":"$/progress","params":{"token":"rustAnalyzer/Loading","value":{"kind":"report","message":"metadata foo"}}} rust-analyzer: [DEBUG lsp_server::msg] > {"jsonrpc":"2.0","method":"$/progress","params":{"token":"rustAnalyzer/Loading","value":{"kind":"report","message":"metadata foo"}}} rust-analyzer: [DEBUG lsp_server::msg] > {"jsonrpc":"2.0","method":"$/progress","params":{"token":"rustAnalyzer/Loading","value":{"kind":"report","message":"metadata foo"}}} rust-analyzer: [DEBUG lsp_server::msg] > {"jsonrpc":"2.0","method":"$/progress","params":{"token":"rustAnalyzer/Loading","value":{"kind":"end"}}} rust-analyzer: [DEBUG lsp_server::msg] > {"jsonrpc":"2.0","id":5,"method":"window/workDoneProgress/create","params":{"token":"rustAnalyzer/Roots Scanned"}} rust-analyzer: [DEBUG lsp_server::msg] > {"jsonrpc":"2.0","method":"$/progress","params":{"token":"rustAnalyzer/Roots Scanned","value":{"kind":"begin","title":"Roots Scanned","message":"0/12","percentage":0}}} rust-analyzer: [DEBUG lsp_server::msg] > {"jsonrpc":"2.0","method":"$/progress","params":{"token":"rustAnalyzer/Roots Scanned","value":{"kind":"report","message":"1/12","percentage":8}}} rust-analyzer: [DEBUG lsp_server::msg] < {"jsonrpc":"2.0","result":null,"id":5} rust-analyzer: [DEBUG lsp_server::msg] > {"jsonrpc":"2.0","method":"$/progress","params":{"token":"rustAnalyzer/Roots Scanned","value":{"kind":"report","message":"2/12","percentage":16}}} rust-analyzer: [DEBUG lsp_server::msg] > {"jsonrpc":"2.0","method":"$/progress","params":{"token":"rustAnalyzer/Roots Scanned","value":{"kind":"report","message":"3/12","percentage":25}}} rust-analyzer: [DEBUG lsp_server::msg] > {"jsonrpc":"2.0","method":"$/progress","params":{"token":"rustAnalyzer/Roots Scanned","value":{"kind":"report","message":"4/12","percentage":33}}} rust-analyzer: [DEBUG lsp_server::msg] > {"jsonrpc":"2.0","method":"$/progress","params":{"token":"rustAnalyzer/Roots Scanned","value":{"kind":"report","message":"5/12","percentage":41}}} rust-analyzer: [DEBUG lsp_server::msg] > {"jsonrpc":"2.0","method":"$/progress","params":{"token":"rustAnalyzer/Roots Scanned","value":{"kind":"report","message":"6/12","percentage":50}}} rust-analyzer: [DEBUG lsp_server::msg] > {"jsonrpc":"2.0","method":"$/progress","params":{"token":"rustAnalyzer/Roots Scanned","value":{"kind":"report","message":"7/12","percentage":58}}} rust-analyzer: [DEBUG lsp_server::msg] > {"jsonrpc":"2.0","method":"$/progress","params":{"token":"rustAnalyzer/Roots Scanned","value":{"kind":"report","message":"8/12","percentage":66}}} rust-analyzer: [DEBUG lsp_server::msg] > {"jsonrpc":"2.0","method":"$/progress","params":{"token":"rustAnalyzer/Roots Scanned","value":{"kind":"report","message":"9/12","percentage":75}}} rust-analyzer: [DEBUG lsp_server::msg] > {"jsonrpc":"2.0","method":"$/progress","params":{"token":"rustAnalyzer/Roots Scanned","value":{"kind":"report","message":"10/12","percentage":83}}} rust-analyzer: [DEBUG lsp_server::msg] > {"jsonrpc":"2.0","method":"$/progress","params":{"token":"rustAnalyzer/Roots Scanned","value":{"kind":"report","message":"11/12","percentage":91}}} rust-analyzer: [DEBUG lsp_server::msg] > {"jsonrpc":"2.0","method":"$/progress","params":{"token":"rustAnalyzer/Roots Scanned","value":{"kind":"end","message":"12/12"}}} rust-analyzer: [DEBUG lsp_server::msg] > {"jsonrpc":"2.0","method":"$/progress","params":{"token":"rustAnalyzer/Fetching","value":{"kind":"end"}}} rust-analyzer: [DEBUG lsp_server::msg] > {"jsonrpc":"2.0","id":6,"method":"window/workDoneProgress/create","params":{"token":"rustAnalyzer/Indexing"}} rust-analyzer: [DEBUG lsp_server::msg] > {"jsonrpc":"2.0","method":"$/progress","params":{"token":"rustAnalyzer/Indexing","value":{"kind":"begin","title":"Indexing","percentage":0}}} rust-analyzer: [DEBUG lsp_server::msg] > {"jsonrpc":"2.0","method":"$/progress","params":{"token":"rustAnalyzer/Indexing","value":{"kind":"report","message":"0/12 (core)","percentage":0}}} rust-analyzer: [DEBUG lsp_server::msg] < {"jsonrpc":"2.0","result":null,"id":6} rust-analyzer: [DEBUG lsp_server::msg] > {"jsonrpc":"2.0","id":7,"method":"window/workDoneProgress/create","params":{"token":"rustAnalyzer/cargo check"}} rust-analyzer: [DEBUG lsp_server::msg] > {"jsonrpc":"2.0","method":"$/progress","params":{"token":"rustAnalyzer/cargo check","value":{"kind":"begin","title":"cargo check"}}} rust-analyzer: [DEBUG lsp_server::msg] < {"jsonrpc":"2.0","params":{"textDocument":{"uri":"file:///private/tmp/foo/foo/src/main.rs","version":2},"contentChanges":[{"rangeLength":1,"range":{"start":{"line":3,"character":0},"end":{"line":3,"character":1}},"text":""}]},"method":"textDocument/didChange"} rust-analyzer: [DEBUG lsp_server::msg] < {"jsonrpc":"2.0","params":{"textDocument":{"uri":"file:///private/tmp/foo/foo/src/main.rs"}},"method":"textDocument/didSave"} rust-analyzer: [DEBUG lsp_server::msg] < {"jsonrpc":"2.0","result":null,"id":7} rust-analyzer: [DEBUG lsp_server::msg] > {"jsonrpc":"2.0","method":"$/progress","params":{"token":"rustAnalyzer/Indexing","value":{"kind":"end"}}} rust-analyzer: [DEBUG lsp_server::msg] > {"jsonrpc":"2.0","method":"$/progress","params":{"token":"rustAnalyzer/cargo check","value":{"kind":"end"}}} rust-analyzer: [DEBUG lsp_server::msg] > {"jsonrpc":"2.0","id":8,"method":"window/workDoneProgress/create","params":{"token":"rustAnalyzer/cargo check"}} rust-analyzer: [DEBUG lsp_server::msg] > {"jsonrpc":"2.0","method":"$/progress","params":{"token":"rustAnalyzer/cargo check","value":{"kind":"begin","title":"cargo check"}}} rust-analyzer: [DEBUG lsp_server::msg] < {"jsonrpc":"2.0","result":null,"id":8} rust-analyzer: [DEBUG lsp_server::msg] < {"jsonrpc":"2.0","params":{"textDocument":{"uri":"file:///private/tmp/foo/foo/src/main.rs"},"position":{"line":3,"character":0}},"method":"textDocument/documentHighlight","id":5} rust-analyzer: [DEBUG lsp_server::msg] > {"jsonrpc":"2.0","method":"$/progress","params":{"token":"rustAnalyzer/cargo check","value":{"kind":"report","message":"foo"}}} rust-analyzer: [DEBUG lsp_server::msg] > {"jsonrpc":"2.0","method":"$/progress","params":{"token":"rustAnalyzer/cargo check","value":{"kind":"report","message":"foo"}}} rust-analyzer: [DEBUG lsp_server::msg] > {"jsonrpc":"2.0","method":"$/progress","params":{"token":"rustAnalyzer/cargo check","value":{"kind":"end"}}} rust-analyzer: [DEBUG lsp_server::msg] < {"jsonrpc":"2.0","params":{"textDocument":{"uri":"file:///private/tmp/foo/foo/src/main.rs"},"position":{"line":1,"character":30}},"method":"textDocument/documentHighlight","id":6} rust-analyzer: [DEBUG lsp_server::msg] < {"jsonrpc":"2.0","params":{"range":{"start":{"line":1,"character":30},"end":{"line":1,"character":30}},"textDocument":{"uri":"file:///private/tmp/foo/foo/src/main.rs"},"context":{"diagnostics":[]}},"method":"textDocument/codeAction","id":7} rust-analyzer: [DEBUG lsp_server::msg] < {"jsonrpc":"2.0","params":{"textDocument":{"uri":"file:///private/tmp/foo/foo/src/main.rs","version":4},"contentChanges":[{"rangeLength":0,"range":{"start":{"line":1,"character":30},"end":{"line":1,"character":30}},"text":"\n"},{"rangeLength":0,"range":{"start":{"line":2,"character":0},"end":{"line":2,"character":0}},"text":" "}]},"method":"textDocument/didChange"} rust-analyzer: [DEBUG lsp_server::msg] < {"jsonrpc":"2.0","params":{"textDocument":{"uri":"file:///private/tmp/foo/foo/src/main.rs"},"position":{"line":2,"character":4}},"method":"textDocument/documentHighlight","id":8} rust-analyzer: [DEBUG lsp_server::msg] > {"jsonrpc":"2.0","id":7,"error":{"code":-32801,"message":"content modified"}} rust-analyzer: [DEBUG lsp_server::msg] > {"jsonrpc":"2.0","id":6,"error":{"code":-32801,"message":"content modified"}} rust-analyzer: [DEBUG lsp_server::msg] > {"jsonrpc":"2.0","id":5,"error":{"code":-32801,"message":"content modified"}} rust-analyzer: [DEBUG lsp_server::msg] > {"jsonrpc":"2.0","id":9,"method":"window/workDoneProgress/create","params":{"token":"rustAnalyzer/Indexing"}} rust-analyzer: [DEBUG lsp_server::msg] > {"jsonrpc":"2.0","method":"$/progress","params":{"token":"rustAnalyzer/Indexing","value":{"kind":"begin","title":"Indexing","percentage":0}}} rust-analyzer: [DEBUG lsp_server::msg] > {"jsonrpc":"2.0","method":"$/progress","params":{"token":"rustAnalyzer/Indexing","value":{"kind":"report","message":"0/12 (core)","percentage":0}}} rust-analyzer: [DEBUG lsp_server::msg] < {"jsonrpc":"2.0","result":null,"id":9} rust-analyzer: [DEBUG lsp_server::msg] > {"jsonrpc":"2.0","method":"$/progress","params":{"token":"rustAnalyzer/Indexing","value":{"kind":"report","message":"1/12 (alloc)","percentage":8}}} rust-analyzer: [DEBUG lsp_server::msg] > {"jsonrpc":"2.0","method":"$/progress","params":{"token":"rustAnalyzer/Indexing","value":{"kind":"report","message":"2/12 (unwind)","percentage":16}}} rust-analyzer: [DEBUG lsp_server::msg] > {"jsonrpc":"2.0","method":"$/progress","params":{"token":"rustAnalyzer/Indexing","value":{"kind":"report","message":"3/12 (std_detect)","percentage":25}}} rust-analyzer: [DEBUG lsp_server::msg] > {"jsonrpc":"2.0","method":"$/progress","params":{"token":"rustAnalyzer/Indexing","value":{"kind":"report","message":"4/12 (panic_abort)","percentage":33}}} rust-analyzer: [DEBUG lsp_server::msg] > {"jsonrpc":"2.0","method":"$/progress","params":{"token":"rustAnalyzer/Indexing","value":{"kind":"report","message":"5/12 (panic_unwind)","percentage":41}}} rust-analyzer: [DEBUG lsp_server::msg] > {"jsonrpc":"2.0","method":"$/progress","params":{"token":"rustAnalyzer/Indexing","value":{"kind":"report","message":"6/12 (profiler_builtins)","percentage":50}}} rust-analyzer: [DEBUG lsp_server::msg] > {"jsonrpc":"2.0","method":"$/progress","params":{"token":"rustAnalyzer/Indexing","value":{"kind":"report","message":"7/12 (term)","percentage":58}}} rust-analyzer: [DEBUG lsp_server::msg] > {"jsonrpc":"2.0","method":"$/progress","params":{"token":"rustAnalyzer/Indexing","value":{"kind":"report","message":"8/12 (test)","percentage":66}}} rust-analyzer: [DEBUG lsp_server::msg] > {"jsonrpc":"2.0","method":"$/progress","params":{"token":"rustAnalyzer/Indexing","value":{"kind":"report","message":"9/12 (std)","percentage":75}}} rust-analyzer: [DEBUG lsp_server::msg] > {"jsonrpc":"2.0","id":8,"result":null} rust-analyzer: [DEBUG lsp_server::msg] > {"jsonrpc":"2.0","method":"textDocument/publishDiagnostics","params":{"uri":"file:///private/tmp/foo/foo/src/main.rs","diagnostics":[{"range":{"start":{"line":0,"character":0},"end":{"line":0,"character":3}},"severity":4,"code":"unlinked-file","codeDescription":{"href":"https://rust-analyzer.github.io/manual.html#unlinked-file"},"source":"rust-analyzer","message":"file not included in module tree"}],"version":4}} rust-analyzer: [DEBUG lsp_server::msg] < {"jsonrpc":"2.0","params":{"range":{"start":{"line":2,"character":4},"end":{"line":2,"character":4}},"textDocument":{"uri":"file:///private/tmp/foo/foo/src/main.rs"},"context":{"diagnostics":[]}},"method":"textDocument/codeAction","id":9} rust-analyzer: [DEBUG lsp_server::msg] > {"jsonrpc":"2.0","id":9,"result":[]} rust-analyzer: [DEBUG lsp_server::msg] > {"jsonrpc":"2.0","method":"$/progress","params":{"token":"rustAnalyzer/Indexing","value":{"kind":"report","message":"10/12 (proc_macro)","percentage":83}}} rust-analyzer: [DEBUG lsp_server::msg] > {"jsonrpc":"2.0","method":"$/progress","params":{"token":"rustAnalyzer/Indexing","value":{"kind":"report","message":"11/12 (foo)","percentage":91}}} rust-analyzer: [DEBUG lsp_server::msg] > {"jsonrpc":"2.0","method":"$/progress","params":{"token":"rustAnalyzer/Indexing","value":{"kind":"end"}}} rust-analyzer: [DEBUG lsp_server::msg] < {"jsonrpc":"2.0","params":{"textDocument":{"uri":"file:///private/tmp/foo/foo/src/main.rs","version":5},"contentChanges":[{"rangeLength":0,"range":{"start":{"line":2,"character":4},"end":{"line":2,"character":4}},"text":"// "}]},"method":"textDocument/didChange"} rust-analyzer: [DEBUG lsp_server::msg] > {"jsonrpc":"2.0","id":10,"method":"window/workDoneProgress/create","params":{"token":"rustAnalyzer/Indexing"}} rust-analyzer: [DEBUG lsp_server::msg] > {"jsonrpc":"2.0","method":"$/progress","params":{"token":"rustAnalyzer/Indexing","value":{"kind":"begin","title":"Indexing","percentage":0}}} rust-analyzer: [DEBUG lsp_server::msg] > {"jsonrpc":"2.0","method":"$/progress","params":{"token":"rustAnalyzer/Indexing","value":{"kind":"report","message":"11/12 (foo)","percentage":91}}} rust-analyzer: [DEBUG lsp_server::msg] > {"jsonrpc":"2.0","method":"$/progress","params":{"token":"rustAnalyzer/Indexing","value":{"kind":"end"}}} rust-analyzer: [DEBUG lsp_server::msg] < {"jsonrpc":"2.0","params":{"textDocument":{"uri":"file:///private/tmp/foo/foo/src/main.rs"},"position":{"line":2,"character":7}},"method":"textDocument/documentHighlight","id":10} rust-analyzer: [DEBUG lsp_server::msg] > {"jsonrpc":"2.0","id":10,"result":null} rust-analyzer: [DEBUG lsp_server::msg] < {"jsonrpc":"2.0","result":null,"id":10} rust-analyzer: [DEBUG lsp_server::msg] < {"jsonrpc":"2.0","params":{"textDocument":{"uri":"file:///private/tmp/foo/foo/src/main.rs","version":6},"contentChanges":[{"rangeLength":1,"range":{"start":{"line":2,"character":6},"end":{"line":2,"character":7}},"text":""}]},"method":"textDocument/didChange"} rust-analyzer: [DEBUG lsp_server::msg] > {"jsonrpc":"2.0","id":11,"method":"window/workDoneProgress/create","params":{"token":"rustAnalyzer/Indexing"}} rust-analyzer: [DEBUG lsp_server::msg] > {"jsonrpc":"2.0","method":"$/progress","params":{"token":"rustAnalyzer/Indexing","value":{"kind":"begin","title":"Indexing","percentage":0}}} rust-analyzer: [DEBUG lsp_server::msg] > {"jsonrpc":"2.0","method":"$/progress","params":{"token":"rustAnalyzer/Indexing","value":{"kind":"report","message":"11/12 (foo)","percentage":91}}} rust-analyzer: [DEBUG lsp_server::msg] > {"jsonrpc":"2.0","method":"$/progress","params":{"token":"rustAnalyzer/Indexing","value":{"kind":"end"}}} rust-analyzer: [DEBUG lsp_server::msg] < {"jsonrpc":"2.0","params":{"textDocument":{"uri":"file:///private/tmp/foo/foo/src/main.rs"},"position":{"line":2,"character":6}},"method":"textDocument/documentHighlight","id":11} rust-analyzer: [DEBUG lsp_server::msg] > {"jsonrpc":"2.0","id":11,"result":null} rust-analyzer: [DEBUG lsp_server::msg] < {"jsonrpc":"2.0","result":null,"id":11} rust-analyzer: [DEBUG lsp_server::msg] < {"jsonrpc":"2.0","params":{"textDocument":{"uri":"file:///private/tmp/foo/foo/src/main.rs","version":7},"contentChanges":[{"rangeLength":1,"range":{"start":{"line":2,"character":5},"end":{"line":2,"character":6}},"text":""}]},"method":"textDocument/didChange"} rust-analyzer: [DEBUG lsp_server::msg] > {"jsonrpc":"2.0","id":12,"method":"window/workDoneProgress/create","params":{"token":"rustAnalyzer/Indexing"}} rust-analyzer: [DEBUG lsp_server::msg] > {"jsonrpc":"2.0","method":"$/progress","params":{"token":"rustAnalyzer/Indexing","value":{"kind":"begin","title":"Indexing","percentage":0}}} rust-analyzer: [DEBUG lsp_server::msg] > {"jsonrpc":"2.0","method":"$/progress","params":{"token":"rustAnalyzer/Indexing","value":{"kind":"report","message":"11/12 (foo)","percentage":91}}} rust-analyzer: [DEBUG lsp_server::msg] > {"jsonrpc":"2.0","method":"$/progress","params":{"token":"rustAnalyzer/Indexing","value":{"kind":"end"}}} rust-analyzer: [DEBUG lsp_server::msg] > {"jsonrpc":"2.0","method":"textDocument/publishDiagnostics","params":{"uri":"file:///private/tmp/foo/foo/src/main.rs","diagnostics":[{"range":{"start":{"line":2,"character":4},"end":{"line":2,"character":4}},"severity":1,"code":"syntax-error","codeDescription":{"href":"https://rust-analyzer.github.io/manual.html#syntax-error"},"source":"rust-analyzer","message":"Syntax Error: expected expression"},{"range":{"start":{"line":0,"character":0},"end":{"line":0,"character":3}},"severity":4,"code":"unlinked-file","codeDescription":{"href":"https://rust-analyzer.github.io/manual.html#unlinked-file"},"source":"rust-analyzer","message":"file not included in module tree"}],"version":7}} rust-analyzer: [DEBUG lsp_server::msg] < {"jsonrpc":"2.0","params":{"textDocument":{"uri":"file:///private/tmp/foo/foo/src/main.rs"},"position":{"line":2,"character":5}},"method":"textDocument/documentHighlight","id":12} rust-analyzer: [DEBUG lsp_server::msg] > {"jsonrpc":"2.0","id":12,"result":null} rust-analyzer: [DEBUG lsp_server::msg] < {"jsonrpc":"2.0","result":null,"id":12} rust-analyzer: [DEBUG lsp_server::msg] < {"jsonrpc":"2.0","params":{"range":{"start":{"line":2,"character":5},"end":{"line":2,"character":5}},"textDocument":{"uri":"file:///private/tmp/foo/foo/src/main.rs"},"context":{"diagnostics":[]}},"method":"textDocument/codeAction","id":13} rust-analyzer: [DEBUG lsp_server::msg] > {"jsonrpc":"2.0","id":13,"result":[]} rust-analyzer: [DEBUG lsp_server::msg] < {"jsonrpc":"2.0","params":{"textDocument":{"uri":"file:///private/tmp/foo/foo/src/main.rs","version":8},"contentChanges":[{"rangeLength":1,"range":{"start":{"line":2,"character":4},"end":{"line":2,"character":5}},"text":""}]},"method":"textDocument/didChange"} rust-analyzer: [DEBUG lsp_server::msg] > {"jsonrpc":"2.0","id":13,"method":"window/workDoneProgress/create","params":{"token":"rustAnalyzer/Indexing"}} rust-analyzer: [DEBUG lsp_server::msg] > {"jsonrpc":"2.0","method":"$/progress","params":{"token":"rustAnalyzer/Indexing","value":{"kind":"begin","title":"Indexing","percentage":0}}} rust-analyzer: [DEBUG lsp_server::msg] > {"jsonrpc":"2.0","method":"$/progress","params":{"token":"rustAnalyzer/Indexing","value":{"kind":"report","message":"3/12 (std_detect)","percentage":25}}} rust-analyzer: [DEBUG lsp_server::msg] > {"jsonrpc":"2.0","method":"$/progress","params":{"token":"rustAnalyzer/Indexing","value":{"kind":"report","message":"11/12 (foo)","percentage":91}}} rust-analyzer: [DEBUG lsp_server::msg] > {"jsonrpc":"2.0","method":"$/progress","params":{"token":"rustAnalyzer/Indexing","value":{"kind":"end"}}} rust-analyzer: [DEBUG lsp_server::msg] > {"jsonrpc":"2.0","method":"textDocument/publishDiagnostics","params":{"uri":"file:///private/tmp/foo/foo/src/main.rs","diagnostics":[{"range":{"start":{"line":0,"character":0},"end":{"line":0,"character":3}},"severity":4,"code":"unlinked-file","codeDescription":{"href":"https://rust-analyzer.github.io/manual.html#unlinked-file"},"source":"rust-analyzer","message":"file not included in module tree"}],"version":8}} rust-analyzer: [DEBUG lsp_server::msg] < {"jsonrpc":"2.0","params":{"textDocument":{"uri":"file:///private/tmp/foo/foo/src/main.rs"},"position":{"line":2,"character":4}},"method":"textDocument/documentHighlight","id":14} rust-analyzer: [DEBUG lsp_server::msg] > {"jsonrpc":"2.0","id":14,"result":null} rust-analyzer: [DEBUG lsp_server::msg] < {"jsonrpc":"2.0","result":null,"id":13} rust-analyzer: [DEBUG lsp_server::msg] < {"jsonrpc":"2.0","params":{"range":{"start":{"line":2,"character":4},"end":{"line":2,"character":4}},"textDocument":{"uri":"file:///private/tmp/foo/foo/src/main.rs"},"context":{"diagnostics":[]}},"method":"textDocument/codeAction","id":15} rust-analyzer: [DEBUG lsp_server::msg] > {"jsonrpc":"2.0","id":15,"result":[]} rust-analyzer: [DEBUG lsp_server::msg] < {"jsonrpc":"2.0","params":{"textDocument":{"uri":"file:///private/tmp/foo/foo/src/main.rs","version":9},"contentChanges":[{"rangeLength":0,"range":{"start":{"line":2,"character":4},"end":{"line":2,"character":4}},"text":" "}]},"method":"textDocument/didChange"} rust-analyzer: [DEBUG lsp_server::msg] > {"jsonrpc":"2.0","id":14,"method":"window/workDoneProgress/create","params":{"token":"rustAnalyzer/Indexing"}} rust-analyzer: [DEBUG lsp_server::msg] > {"jsonrpc":"2.0","method":"$/progress","params":{"token":"rustAnalyzer/Indexing","value":{"kind":"begin","title":"Indexing","percentage":0}}} rust-analyzer: [DEBUG lsp_server::msg] > {"jsonrpc":"2.0","method":"$/progress","params":{"token":"rustAnalyzer/Indexing","value":{"kind":"report","message":"3/12 (std_detect)","percentage":25}}} rust-analyzer: [DEBUG lsp_server::msg] > {"jsonrpc":"2.0","method":"$/progress","params":{"token":"rustAnalyzer/Indexing","value":{"kind":"report","message":"11/12 (foo)","percentage":91}}} rust-analyzer: [DEBUG lsp_server::msg] > {"jsonrpc":"2.0","method":"$/progress","params":{"token":"rustAnalyzer/Indexing","value":{"kind":"end"}}} rust-analyzer: [DEBUG lsp_server::msg] < {"jsonrpc":"2.0","params":{"textDocument":{"uri":"file:///private/tmp/foo/foo/src/main.rs"},"position":{"line":2,"character":5}},"method":"textDocument/documentHighlight","id":16} rust-analyzer: [DEBUG lsp_server::msg] > {"jsonrpc":"2.0","id":16,"result":null} rust-analyzer: [DEBUG lsp_server::msg] < {"jsonrpc":"2.0","result":null,"id":14} rust-analyzer: [DEBUG lsp_server::msg] < {"jsonrpc":"2.0","params":{"textDocument":{"uri":"file:///private/tmp/foo/foo/src/main.rs","version":10},"contentChanges":[{"rangeLength":0,"range":{"start":{"line":2,"character":5},"end":{"line":2,"character":5}},"text":" "}]},"method":"textDocument/didChange"} rust-analyzer: [DEBUG lsp_server::msg] > {"jsonrpc":"2.0","id":15,"method":"window/workDoneProgress/create","params":{"token":"rustAnalyzer/Indexing"}} rust-analyzer: [DEBUG lsp_server::msg] > {"jsonrpc":"2.0","method":"$/progress","params":{"token":"rustAnalyzer/Indexing","value":{"kind":"begin","title":"Indexing","percentage":0}}} rust-analyzer: [DEBUG lsp_server::msg] > {"jsonrpc":"2.0","method":"$/progress","params":{"token":"rustAnalyzer/Indexing","value":{"kind":"report","message":"7/12 (term)","percentage":58}}} rust-analyzer: [DEBUG lsp_server::msg] > {"jsonrpc":"2.0","method":"$/progress","params":{"token":"rustAnalyzer/Indexing","value":{"kind":"report","message":"11/12 (foo)","percentage":91}}} rust-analyzer: [DEBUG lsp_server::msg] > {"jsonrpc":"2.0","method":"$/progress","params":{"token":"rustAnalyzer/Indexing","value":{"kind":"end"}}} rust-analyzer: [DEBUG lsp_server::msg] < {"jsonrpc":"2.0","params":{"textDocument":{"uri":"file:///private/tmp/foo/foo/src/main.rs"},"position":{"line":2,"character":6}},"method":"textDocument/documentHighlight","id":17} rust-analyzer: [DEBUG lsp_server::msg] > {"jsonrpc":"2.0","id":17,"result":null} rust-analyzer: [DEBUG lsp_server::msg] < {"jsonrpc":"2.0","result":null,"id":15} rust-analyzer: [DEBUG lsp_server::msg] < {"jsonrpc":"2.0","params":{"textDocument":{"uri":"file:///private/tmp/foo/foo/src/main.rs","version":11},"contentChanges":[{"rangeLength":0,"range":{"start":{"line":2,"character":6},"end":{"line":2,"character":6}},"text":" "}]},"method":"textDocument/didChange"} rust-analyzer: [DEBUG lsp_server::msg] > {"jsonrpc":"2.0","id":16,"method":"window/workDoneProgress/create","params":{"token":"rustAnalyzer/Indexing"}} rust-analyzer: [DEBUG lsp_server::msg] > {"jsonrpc":"2.0","method":"$/progress","params":{"token":"rustAnalyzer/Indexing","value":{"kind":"begin","title":"Indexing","percentage":0}}} rust-analyzer: [DEBUG lsp_server::msg] > {"jsonrpc":"2.0","method":"$/progress","params":{"token":"rustAnalyzer/Indexing","value":{"kind":"report","message":"3/12 (std_detect)","percentage":25}}} rust-analyzer: [DEBUG lsp_server::msg] > {"jsonrpc":"2.0","method":"$/progress","params":{"token":"rustAnalyzer/Indexing","value":{"kind":"report","message":"11/12 (foo)","percentage":91}}} rust-analyzer: [DEBUG lsp_server::msg] > {"jsonrpc":"2.0","method":"$/progress","params":{"token":"rustAnalyzer/Indexing","value":{"kind":"end"}}} rust-analyzer: [DEBUG lsp_server::msg] < {"jsonrpc":"2.0","params":{"textDocument":{"uri":"file:///private/tmp/foo/foo/src/main.rs"},"position":{"line":2,"character":7}},"method":"textDocument/documentHighlight","id":18} rust-analyzer: [DEBUG lsp_server::msg] > {"jsonrpc":"2.0","id":18,"result":null} rust-analyzer: [DEBUG lsp_server::msg] < {"jsonrpc":"2.0","result":null,"id":16} rust-analyzer: [DEBUG lsp_server::msg] < {"jsonrpc":"2.0","params":{"textDocument":{"uri":"file:///private/tmp/foo/foo/src/main.rs","version":12},"contentChanges":[{"rangeLength":0,"range":{"start":{"line":2,"character":7},"end":{"line":2,"character":7}},"text":" "}]},"method":"textDocument/didChange"} rust-analyzer: [DEBUG lsp_server::msg] > {"jsonrpc":"2.0","id":17,"method":"window/workDoneProgress/create","params":{"token":"rustAnalyzer/Indexing"}} rust-analyzer: [DEBUG lsp_server::msg] > {"jsonrpc":"2.0","method":"$/progress","params":{"token":"rustAnalyzer/Indexing","value":{"kind":"begin","title":"Indexing","percentage":0}}} rust-analyzer: [DEBUG lsp_server::msg] > {"jsonrpc":"2.0","method":"$/progress","params":{"token":"rustAnalyzer/Indexing","value":{"kind":"report","message":"1/12 (alloc)","percentage":8}}} rust-analyzer: [DEBUG lsp_server::msg] > {"jsonrpc":"2.0","method":"$/progress","params":{"token":"rustAnalyzer/Indexing","value":{"kind":"report","message":"11/12 (foo)","percentage":91}}} rust-analyzer: [DEBUG lsp_server::msg] > {"jsonrpc":"2.0","method":"$/progress","params":{"token":"rustAnalyzer/Indexing","value":{"kind":"end"}}} rust-analyzer: [DEBUG lsp_server::msg] < {"jsonrpc":"2.0","params":{"textDocument":{"uri":"file:///private/tmp/foo/foo/src/main.rs"},"position":{"line":2,"character":8}},"method":"textDocument/documentHighlight","id":19} rust-analyzer: [DEBUG lsp_server::msg] > {"jsonrpc":"2.0","id":19,"result":null} rust-analyzer: [DEBUG lsp_server::msg] < {"jsonrpc":"2.0","result":null,"id":17} rust-analyzer: [DEBUG lsp_server::msg] < {"jsonrpc":"2.0","params":{"textDocument":{"uri":"file:///private/tmp/foo/foo/src/main.rs","version":13},"contentChanges":[{"rangeLength":0,"range":{"start":{"line":2,"character":8},"end":{"line":2,"character":8}},"text":" "}]},"method":"textDocument/didChange"} rust-analyzer: [DEBUG lsp_server::msg] > {"jsonrpc":"2.0","id":18,"method":"window/workDoneProgress/create","params":{"token":"rustAnalyzer/Indexing"}} rust-analyzer: [DEBUG lsp_server::msg] > {"jsonrpc":"2.0","method":"$/progress","params":{"token":"rustAnalyzer/Indexing","value":{"kind":"begin","title":"Indexing","percentage":0}}} rust-analyzer: [DEBUG lsp_server::msg] > {"jsonrpc":"2.0","method":"$/progress","params":{"token":"rustAnalyzer/Indexing","value":{"kind":"report","message":"4/12 (panic_abort)","percentage":33}}} rust-analyzer: [DEBUG lsp_server::msg] > {"jsonrpc":"2.0","method":"$/progress","params":{"token":"rustAnalyzer/Indexing","value":{"kind":"report","message":"11/12 (foo)","percentage":91}}} rust-analyzer: [DEBUG lsp_server::msg] > {"jsonrpc":"2.0","method":"$/progress","params":{"token":"rustAnalyzer/Indexing","value":{"kind":"end"}}} rust-analyzer: [DEBUG lsp_server::msg] < {"jsonrpc":"2.0","params":{"textDocument":{"uri":"file:///private/tmp/foo/foo/src/main.rs"},"position":{"line":2,"character":9}},"method":"textDocument/documentHighlight","id":20} rust-analyzer: [DEBUG lsp_server::msg] > {"jsonrpc":"2.0","id":20,"result":null} rust-analyzer: [DEBUG lsp_server::msg] < {"jsonrpc":"2.0","result":null,"id":18} rust-analyzer: [DEBUG lsp_server::msg] < {"jsonrpc":"2.0","params":{"textDocument":{"uri":"file:///private/tmp/foo/foo/src/main.rs","version":14},"contentChanges":[{"rangeLength":0,"range":{"start":{"line":2,"character":9},"end":{"line":2,"character":9}},"text":" "}]},"method":"textDocument/didChange"} rust-analyzer: [DEBUG lsp_server::msg] > {"jsonrpc":"2.0","id":19,"method":"window/workDoneProgress/create","params":{"token":"rustAnalyzer/Indexing"}} rust-analyzer: [DEBUG lsp_server::msg] > {"jsonrpc":"2.0","method":"$/progress","params":{"token":"rustAnalyzer/Indexing","value":{"kind":"begin","title":"Indexing","percentage":0}}} rust-analyzer: [DEBUG lsp_server::msg] > {"jsonrpc":"2.0","method":"$/progress","params":{"token":"rustAnalyzer/Indexing","value":{"kind":"report","message":"3/12 (std_detect)","percentage":25}}} rust-analyzer: [DEBUG lsp_server::msg] > {"jsonrpc":"2.0","method":"$/progress","params":{"token":"rustAnalyzer/Indexing","value":{"kind":"report","message":"11/12 (foo)","percentage":91}}} rust-analyzer: [DEBUG lsp_server::msg] > {"jsonrpc":"2.0","method":"$/progress","params":{"token":"rustAnalyzer/Indexing","value":{"kind":"end"}}} rust-analyzer: [DEBUG lsp_server::msg] < {"jsonrpc":"2.0","params":{"textDocument":{"uri":"file:///private/tmp/foo/foo/src/main.rs"},"position":{"line":2,"character":10}},"method":"textDocument/documentHighlight","id":21} rust-analyzer: [DEBUG lsp_server::msg] > {"jsonrpc":"2.0","id":21,"result":null} rust-analyzer: [DEBUG lsp_server::msg] < {"jsonrpc":"2.0","result":null,"id":19} rust-analyzer: [DEBUG lsp_server::msg] < {"jsonrpc":"2.0","params":{"textDocument":{"uri":"file:///private/tmp/foo/foo/src/main.rs","version":15},"contentChanges":[{"rangeLength":0,"range":{"start":{"line":2,"character":10},"end":{"line":2,"character":10}},"text":" "}]},"method":"textDocument/didChange"} rust-analyzer: [DEBUG lsp_server::msg] > {"jsonrpc":"2.0","id":20,"method":"window/workDoneProgress/create","params":{"token":"rustAnalyzer/Indexing"}} rust-analyzer: [DEBUG lsp_server::msg] > {"jsonrpc":"2.0","method":"$/progress","params":{"token":"rustAnalyzer/Indexing","value":{"kind":"begin","title":"Indexing","percentage":0}}} rust-analyzer: [DEBUG lsp_server::msg] > {"jsonrpc":"2.0","method":"$/progress","params":{"token":"rustAnalyzer/Indexing","value":{"kind":"report","message":"5/12 (panic_unwind)","percentage":41}}} rust-analyzer: [DEBUG lsp_server::msg] > {"jsonrpc":"2.0","method":"$/progress","params":{"token":"rustAnalyzer/Indexing","value":{"kind":"report","message":"11/12 (foo)","percentage":91}}} rust-analyzer: [DEBUG lsp_server::msg] > {"jsonrpc":"2.0","method":"$/progress","params":{"token":"rustAnalyzer/Indexing","value":{"kind":"end"}}} rust-analyzer: [DEBUG lsp_server::msg] < {"jsonrpc":"2.0","params":{"textDocument":{"uri":"file:///private/tmp/foo/foo/src/main.rs"},"position":{"line":2,"character":11}},"method":"textDocument/documentHighlight","id":22} rust-analyzer: [DEBUG lsp_server::msg] > {"jsonrpc":"2.0","id":22,"result":null} rust-analyzer: [DEBUG lsp_server::msg] < {"jsonrpc":"2.0","result":null,"id":20} rust-analyzer: [DEBUG lsp_server::msg] < {"jsonrpc":"2.0","params":{"textDocument":{"uri":"file:///private/tmp/foo/foo/src/main.rs","version":16},"contentChanges":[{"rangeLength":0,"range":{"start":{"line":2,"character":11},"end":{"line":2,"character":11}},"text":" "}]},"method":"textDocument/didChange"} rust-analyzer: [DEBUG lsp_server::msg] > {"jsonrpc":"2.0","id":21,"method":"window/workDoneProgress/create","params":{"token":"rustAnalyzer/Indexing"}} rust-analyzer: [DEBUG lsp_server::msg] > {"jsonrpc":"2.0","method":"$/progress","params":{"token":"rustAnalyzer/Indexing","value":{"kind":"begin","title":"Indexing","percentage":0}}} rust-analyzer: [DEBUG lsp_server::msg] > {"jsonrpc":"2.0","method":"$/progress","params":{"token":"rustAnalyzer/Indexing","value":{"kind":"report","message":"6/12 (profiler_builtins)","percentage":50}}} rust-analyzer: [DEBUG lsp_server::msg] > {"jsonrpc":"2.0","method":"$/progress","params":{"token":"rustAnalyzer/Indexing","value":{"kind":"report","message":"11/12 (foo)","percentage":91}}} rust-analyzer: [DEBUG lsp_server::msg] > {"jsonrpc":"2.0","method":"$/progress","params":{"token":"rustAnalyzer/Indexing","value":{"kind":"end"}}} rust-analyzer: [DEBUG lsp_server::msg] < {"jsonrpc":"2.0","params":{"textDocument":{"uri":"file:///private/tmp/foo/foo/src/main.rs"},"position":{"line":2,"character":12}},"method":"textDocument/documentHighlight","id":23} rust-analyzer: [DEBUG lsp_server::msg] > {"jsonrpc":"2.0","id":23,"result":null} rust-analyzer: [DEBUG lsp_server::msg] < {"jsonrpc":"2.0","result":null,"id":21} rust-analyzer: [DEBUG lsp_server::msg] < {"jsonrpc":"2.0","params":{"textDocument":{"uri":"file:///private/tmp/foo/foo/src/main.rs","version":17},"contentChanges":[{"rangeLength":0,"range":{"start":{"line":2,"character":12},"end":{"line":2,"character":12}},"text":" "}]},"method":"textDocument/didChange"} rust-analyzer: [DEBUG lsp_server::msg] > {"jsonrpc":"2.0","id":22,"method":"window/workDoneProgress/create","params":{"token":"rustAnalyzer/Indexing"}} rust-analyzer: [DEBUG lsp_server::msg] > {"jsonrpc":"2.0","method":"$/progress","params":{"token":"rustAnalyzer/Indexing","value":{"kind":"begin","title":"Indexing","percentage":0}}} rust-analyzer: [DEBUG lsp_server::msg] > {"jsonrpc":"2.0","method":"$/progress","params":{"token":"rustAnalyzer/Indexing","value":{"kind":"report","message":"1/12 (alloc)","percentage":8}}} rust-analyzer: [DEBUG lsp_server::msg] > {"jsonrpc":"2.0","method":"$/progress","params":{"token":"rustAnalyzer/Indexing","value":{"kind":"report","message":"11/12 (foo)","percentage":91}}} rust-analyzer: [DEBUG lsp_server::msg] > {"jsonrpc":"2.0","method":"$/progress","params":{"token":"rustAnalyzer/Indexing","value":{"kind":"end"}}} rust-analyzer: [DEBUG lsp_server::msg] < {"jsonrpc":"2.0","params":{"textDocument":{"uri":"file:///private/tmp/foo/foo/src/main.rs"},"position":{"line":2,"character":13}},"method":"textDocument/documentHighlight","id":24} rust-analyzer: [DEBUG lsp_server::msg] > {"jsonrpc":"2.0","id":24,"result":null} rust-analyzer: [DEBUG lsp_server::msg] < {"jsonrpc":"2.0","result":null,"id":22} rust-analyzer: [DEBUG lsp_server::msg] < {"jsonrpc":"2.0","params":{"textDocument":{"uri":"file:///private/tmp/foo/foo/src/main.rs","version":18},"contentChanges":[{"rangeLength":0,"range":{"start":{"line":2,"character":13},"end":{"line":2,"character":13}},"text":" "}]},"method":"textDocument/didChange"} rust-analyzer: [DEBUG lsp_server::msg] > {"jsonrpc":"2.0","id":23,"method":"window/workDoneProgress/create","params":{"token":"rustAnalyzer/Indexing"}} rust-analyzer: [DEBUG lsp_server::msg] > {"jsonrpc":"2.0","method":"$/progress","params":{"token":"rustAnalyzer/Indexing","value":{"kind":"begin","title":"Indexing","percentage":0}}} rust-analyzer: [DEBUG lsp_server::msg] > {"jsonrpc":"2.0","method":"$/progress","params":{"token":"rustAnalyzer/Indexing","value":{"kind":"report","message":"11/12 (foo)","percentage":91}}} rust-analyzer: [DEBUG lsp_server::msg] > {"jsonrpc":"2.0","method":"$/progress","params":{"token":"rustAnalyzer/Indexing","value":{"kind":"end"}}} rust-analyzer: [DEBUG lsp_server::msg] < {"jsonrpc":"2.0","params":{"textDocument":{"uri":"file:///private/tmp/foo/foo/src/main.rs"},"position":{"line":2,"character":14}},"method":"textDocument/documentHighlight","id":25} rust-analyzer: [DEBUG lsp_server::msg] > {"jsonrpc":"2.0","id":25,"result":null} rust-analyzer: [DEBUG lsp_server::msg] < {"jsonrpc":"2.0","result":null,"id":23} |
Sorry, I was wrong, we do send that "Indexing" status on every keystroke. |
It doesn't show "Indexing" for me. And even if it would, it shouldn't show it for it for unchanged dependencies, right? |
It does, though:
|
@jonas-schievink I suppose it's not intended that we're calling |
It sort of is, but we can change it so it doesn't do that. |
To clarify, "indexing" and "cargo check" are two completely separate things. If
If The "indexing" is rust-analyzer's internal analysis. There's one UI bug there in that we report "indexing foo" where in fact all we do is "check if caches for There's also a harder implementation issue of the latency/battery life tradeoff here, that is tracked in #9564. |
Hm, it seems like with the last update it improved. Even with the default settings now the indexing only happens on startup and cargo check seems to be run after every save, but it takes only two seconds or something. Only the Indexing takes about 10 seconds after startup, but it is not as bad as it was before where this happened after every save. |
You can disable |
Yes, but it is not really a problem anymore. I think before Indexing and cargo check ran in parallel and their outputs were shown in alternation, so I thought they were related. But now indexing seems to only happen on startup, which I think generally could probably still be avoided, no? And what would be the drawback of disabling cargo check on save? What is it actually used for? The docs only mention "diagnostics". |
It's used to show compilation errors and warnings, the ones you would see if you ran There are some built-in diagnostics, but not a lot. |
And the indexing is for autocompletion? |
For completion, type inference and pretty much every other feature. But if that's indeed the cache priming (and I think it is), those features would work without it, only slower at first. See #1650 for some context. We don't persist anything yet, by design. |
Thanks for the clarification! The indexing at startup is not really that bad. I don't know why it doesn't index on save anymore, but I updated the extension a few days ago so that may be why. |
Thanks, so much faster now 🙌 |
Heads-up: I've seen RA keep rebuilding a project after running |
I use the vscode plugin.
One example is that by default, cargo check is run after every save and it checks all of my dependencies. This has led me to run low on RAM a couple of times and it was a headache to figure out how to fix it. The defaults should definitely prioritize perfomance more in my opinion, even if it means not showing off all features from the start. It is a much better experience to find things you can enable than having to figure out stuff you don't need because its annoying you.
One example is to use
cargo check --workspace
by default, because this is the only code that actually changes. Any dependency infomation should be cached and reused. One problem I haven't figured out yet is how to stop rust-analyzer from "indexing" 2000 packages (including standard libaries) every time I open my project. It seems like this is all metadata which should be cached accross sessions aswell.The text was updated successfully, but these errors were encountered: