joaotavora / eglot

A client for Language Server Protocol servers

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Eglot doesn't display errors when opening file, updates only when the buffer is saved

thblt opened this issue · comments

The general issue is in the title: I need to save the current buffer for Eglot/flymake to add/update error overlays.

Steps to reproduce:

  1. Create a Rust project somewhere with cargo init test, replace contents of the default src/main.rs with:

    fn main() {
        let i = 3;
        println!("{}", i.baz);
    }
  2. From emacs -q (29.1 with latest eglot [1.15.0.20230819.140915] from elpa-devel), open that file, run M-x rust-ts-mode RET, then M-x eglot RET. If prompted for a server, choose rust-analyzer. (I sometimes get prompted, sometimes not, not sure why)

  3. Notice that no error are reported.

  4. Make any change in the file (just add a space at the end of the line), save. Observe that the .baz on line 3 is now underlined in red (as it should).

  5. Delete the erroneous .baz on line 3.

  6. Observe that underlining persists, flymake still reports the now-fixed error.
    2023-08-20T15:21:39,007132272+02:00

  7. Save again. Underlining disappears (as it should).

Contents of *EGLOT (eldoc-bug-rs/(rust-ts-mode rust-mode)) events* buffer:

[internal] Sun Aug 20 15:31:42 2023:
(:message "Running language server: rust-analyzer")
[client-request] (id:1) Sun Aug 20 15:31:42 2023:
(:jsonrpc "2.0" :id 1 :method "initialize" :params
	  (:processId 21742 :clientInfo
		      (:name "Eglot")
		      :rootPath "/home/thblt/temp/eglot-bug-rs/" :rootUri "file:///home/thblt/temp/eglot-bug-rs" :initializationOptions #s(hash-table size 1 test eql rehash-size 1.5 rehash-threshold 0.8125 data
																		      ())
		      :capabilities
		      (:workspace
		       (:applyEdit t :executeCommand
				   (:dynamicRegistration :json-false)
				   :workspaceEdit
				   (:documentChanges t)
				   :didChangeWatchedFiles
				   (:dynamicRegistration t)
				   :symbol
				   (:dynamicRegistration :json-false)
				   :configuration t :workspaceFolders t)
		       :textDocument
		       (:synchronization
			(:dynamicRegistration :json-false :willSave t :willSaveWaitUntil t :didSave t)
			:completion
			(:dynamicRegistration :json-false :completionItem
					      (:snippetSupport :json-false :deprecatedSupport t :resolveSupport
							       (:properties
								["documentation" "details" "additionalTextEdits"])
							       :tagSupport
							       (:valueSet
								[1]))
					      :contextSupport t)
			:hover
			(:dynamicRegistration :json-false :contentFormat
					      ["plaintext"])
			:signatureHelp
			(:dynamicRegistration :json-false :signatureInformation
					      (:parameterInformation
					       (:labelOffsetSupport t)
					       :documentationFormat
					       ["plaintext"]
					       :activeParameterSupport t))
			:references
			(:dynamicRegistration :json-false)
			:definition
			(:dynamicRegistration :json-false :linkSupport t)
			:declaration
			(:dynamicRegistration :json-false :linkSupport t)
			:implementation
			(:dynamicRegistration :json-false :linkSupport t)
			:typeDefinition
			(:dynamicRegistration :json-false :linkSupport t)
			:documentSymbol
			(:dynamicRegistration :json-false :hierarchicalDocumentSymbolSupport t :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]))
			:documentHighlight
			(:dynamicRegistration :json-false)
			:codeAction
			(:dynamicRegistration :json-false :resolveSupport
					      (:properties
					       ["edit" "command"])
					      :dataSupport t :codeActionLiteralSupport
					      (:codeActionKind
					       (:valueSet
						["quickfix" "refactor" "refactor.extract" "refactor.inline" "refactor.rewrite" "source" "source.organizeImports"]))
					      :isPreferredSupport t)
			:formatting
			(:dynamicRegistration :json-false)
			:rangeFormatting
			(:dynamicRegistration :json-false)
			:rename
			(:dynamicRegistration :json-false)
			:inlayHint
			(:dynamicRegistration :json-false)
			:publishDiagnostics
			(:relatedInformation :json-false :codeDescriptionSupport :json-false :tagSupport
					     (:valueSet
					      [1 2])))
		       :window
		       (:showDocument
			(:support t)
			:workDoneProgress t)
		       :general
		       (:positionEncodings
			["utf-32" "utf-8" "utf-16"])
		       :experimental #s(hash-table size 1 test eql rehash-size 1.5 rehash-threshold 0.8125 data
						   ()))
		      :workspaceFolders
		      [(:uri "file:///home/thblt/temp/eglot-bug-rs" :name "~/temp/eglot-bug-rs/")]))
[server-reply] (id:1) Sun Aug 20 15:31:42 2023:
(:jsonrpc "2.0" :id 1 :result
	  (:capabilities
	   (:positionEncoding "utf-32" :textDocumentSync
			      (:openClose t :change 2 :save nil)
			      :selectionRangeProvider t :hoverProvider t :completionProvider
			      (:resolveProvider t :triggerCharacters
						[":" "." "'" "("]
						:completionItem
						(:labelDetailsSupport :json-false))
			      :signatureHelpProvider
			      (:triggerCharacters
			       ["(" "," "<"])
			      :definitionProvider t :typeDefinitionProvider t :implementationProvider t :referencesProvider t :documentHighlightProvider t :documentSymbolProvider t :workspaceSymbolProvider t :codeActionProvider
			      (:codeActionKinds
			       ["" "quickfix" "refactor" "refactor.extract" "refactor.inline" "refactor.rewrite"]
			       :resolveProvider t)
			      :codeLensProvider
			      (:resolveProvider t)
			      :documentFormattingProvider t :documentRangeFormattingProvider :json-false :documentOnTypeFormattingProvider
			      (:firstTriggerCharacter "=" :moreTriggerCharacter
						      ["." ">" "{"])
			      :renameProvider
			      (:prepareProvider t)
			      :foldingRangeProvider t :declarationProvider t :workspace
			      (:workspaceFolders
			       (:supported t :changeNotifications t)
			       :fileOperations
			       (:willRename
				(:filters
				 [(:scheme "file" :pattern
					   (:glob "**/*.rs" :matches "file"))
				  (:scheme "file" :pattern
					   (:glob "**" :matches "folder"))])))
			      :callHierarchyProvider t :semanticTokensProvider
			      (:legend
			       (:tokenTypes
				["comment" "decorator" "enumMember" "enum" "function" "interface" "keyword" "macro" "method" "namespace" "number" "operator" "parameter" "property" "string" "struct" "typeParameter" "variable" "angle" "arithmetic" "attribute" "attributeBracket" "bitwise" "boolean" "brace" "bracket" "builtinAttribute" "builtinType" "character" "colon" "comma" "comparison" "constParameter" "derive" "deriveHelper" "dot" "escapeSequence" "formatSpecifier" "generic" "label" "lifetime" "logical" "macroBang" "parenthesis" "punctuation" "selfKeyword" "selfTypeKeyword" "semicolon" "typeAlias" "toolModule" "union" "unresolvedReference"]
				:tokenModifiers
				["documentation" "declaration" "static" "defaultLibrary" "async" "attribute" "callable" "constant" "consuming" "controlFlow" "crateRoot" "injected" "intraDocLink" "library" "mutable" "public" "reference" "trait" "unsafe"])
			       :range t :full
			       (:delta t))
			      :inlayHintProvider
			      (:resolveProvider t)
			      :experimental
			      (:externalDocs t :hoverRange t :joinLines t :matchingBrace t :moveItem t :onEnter t :openCargoToml t :parentModule t :runnables
					     (:kinds
					      ["cargo"])
					     :ssr t :workspaceSymbolScopeKindFiltering t))
	   :serverInfo
	   (:name "rust-analyzer" :version "1.71.1 (eb26296 2023-08-03)")))
[client-notification] Sun Aug 20 15:31:42 2023:
(:jsonrpc "2.0" :method "initialized" :params #s(hash-table size 1 test eql rehash-size 1.5 rehash-threshold 0.8125 data
							    ()))
[client-notification] Sun Aug 20 15:31:42 2023:
(:jsonrpc "2.0" :method "textDocument/didOpen" :params
	  (:textDocument
	   (:uri "file:///home/thblt/temp/eglot-bug-rs/src/main.rs" :version 0 :languageId "rust" :text "fn main() {\n    let i = 3;\n    println!(\"{}\", i.baz);\n}\n")))
[client-notification] Sun Aug 20 15:31:42 2023:
(:jsonrpc "2.0" :method "workspace/didChangeConfiguration" :params
	  (:settings #s(hash-table size 1 test eql rehash-size 1.5 rehash-threshold 0.8125 data
				   ())))
[client-request] (id:2) Sun Aug 20 15:31:42 2023:
(:jsonrpc "2.0" :id 2 :method "textDocument/inlayHint" :params
	  (:textDocument
	   (:uri "file:///home/thblt/temp/eglot-bug-rs/src/main.rs")
	   :range
	   (:start
	    (:line 0 :character 0)
	    :end
	    (:line 4 :character 0))))
[server-request] (id:0) Sun Aug 20 15:31:42 2023:
(:jsonrpc "2.0" :id 0 :method "window/workDoneProgress/create" :params
	  (:token "rustAnalyzer/Fetching"))
[client-reply] (id:0) Sun Aug 20 15:31:42 2023:
(:jsonrpc "2.0" :id 0 :result nil)
[server-notification] Sun Aug 20 15:31:42 2023:
(:jsonrpc "2.0" :method "$/progress" :params
	  (:token "rustAnalyzer/Fetching" :value
		  (:kind "begin" :title "Fetching" :cancellable :json-false)))
[server-request] (id:1) Sun Aug 20 15:31:42 2023:
(:jsonrpc "2.0" :id 1 :method "workspace/configuration" :params
	  (:items
	   [(:section "rust-analyzer")]))
[client-reply] (id:1) Sun Aug 20 15:31:42 2023:
(:jsonrpc "2.0" :id 1 :result
	  [nil])
[server-reply] (id:2) Sun Aug 20 15:31:42 2023:
(:jsonrpc "2.0" :id 2 :result
	  [])
[server-notification] Sun Aug 20 15:31:42 2023:
(:jsonrpc "2.0" :method "$/progress" :params
	  (:token "rustAnalyzer/Fetching" :value
		  (:kind "report" :cancellable :json-false :message "metadata")))
[server-request] (id:2) Sun Aug 20 15:31:42 2023:
(:jsonrpc "2.0" :id 2 :method "client/registerCapability" :params
	  (:registrations
	   [(:id "workspace/didChangeWatchedFiles" :method "workspace/didChangeWatchedFiles" :registerOptions
		 (:watchers
		  [(:globPattern "/home/thblt/temp/eglot-bug-rs/**/*.rs")
		   (:globPattern "/home/thblt/temp/eglot-bug-rs/**/Cargo.toml")
		   (:globPattern "/home/thblt/temp/eglot-bug-rs/**/Cargo.lock")]))]))
[client-reply] (id:2) Sun Aug 20 15:31:42 2023:
(:jsonrpc "2.0" :id 2 :result nil)
[server-notification] Sun Aug 20 15:31:42 2023:
(:jsonrpc "2.0" :method "$/progress" :params
	  (:token "rustAnalyzer/Fetching" :value
		  (:kind "end")))
[server-request] (id:3) Sun Aug 20 15:31:42 2023:
(:jsonrpc "2.0" :id 3 :method "window/workDoneProgress/create" :params
	  (:token "rustAnalyzer/Roots Scanned"))
[client-reply] (id:3) Sun Aug 20 15:31:42 2023:
(:jsonrpc "2.0" :id 3 :result nil)
[server-notification] Sun Aug 20 15:31:42 2023:
(:jsonrpc "2.0" :method "$/progress" :params
	  (:token "rustAnalyzer/Roots Scanned" :value
		  (:kind "begin" :title "Roots Scanned" :cancellable :json-false :message "0/2" :percentage 0)))
[server-notification] Sun Aug 20 15:31:42 2023:
(:jsonrpc "2.0" :method "$/progress" :params
	  (:token "rustAnalyzer/Roots Scanned" :value
		  (:kind "report" :cancellable :json-false :message "1/2" :percentage 50)))
[server-request] (id:4) Sun Aug 20 15:31:42 2023:
(:jsonrpc "2.0" :id 4 :method "window/workDoneProgress/create" :params
	  (:token "rustAnalyzer/Fetching"))
[client-reply] (id:4) Sun Aug 20 15:31:42 2023:
(:jsonrpc "2.0" :id 4 :result nil)
[server-notification] Sun Aug 20 15:31:42 2023:
(:jsonrpc "2.0" :method "$/progress" :params
	  (:token "rustAnalyzer/Fetching" :value
		  (:kind "begin" :title "Fetching" :cancellable :json-false)))
[server-notification] Sun Aug 20 15:31:42 2023:
(:jsonrpc "2.0" :method "$/progress" :params
	  (:token "rustAnalyzer/Fetching" :value
		  (:kind "report" :cancellable :json-false :message "metadata")))
[server-notification] Sun Aug 20 15:31:42 2023:
(:jsonrpc "2.0" :method "$/progress" :params
	  (:token "rustAnalyzer/Roots Scanned" :value
		  (:kind "end" :message "2/2")))
[server-notification] Sun Aug 20 15:31:42 2023:
(:jsonrpc "2.0" :method "$/progress" :params
	  (:token "rustAnalyzer/Fetching" :value
		  (:kind "end")))
[server-request] (id:5) Sun Aug 20 15:31:42 2023:
(:jsonrpc "2.0" :id 5 :method "window/workDoneProgress/create" :params
	  (:token "rustAnalyzer/Fetching"))
[client-reply] (id:5) Sun Aug 20 15:31:42 2023:
(:jsonrpc "2.0" :id 5 :result nil)
[server-notification] Sun Aug 20 15:31:42 2023:
(:jsonrpc "2.0" :method "$/progress" :params
	  (:token "rustAnalyzer/Fetching" :value
		  (:kind "begin" :title "Fetching" :cancellable :json-false)))
[server-notification] Sun Aug 20 15:31:42 2023:
(:jsonrpc "2.0" :method "$/progress" :params
	  (:token "rustAnalyzer/Fetching" :value
		  (:kind "report" :cancellable :json-false :message "metadata")))
[server-notification] Sun Aug 20 15:31:42 2023:
(:jsonrpc "2.0" :method "$/progress" :params
	  (:token "rustAnalyzer/Fetching" :value
		  (:kind "end")))
[client-request] (id:3) Sun Aug 20 15:31:43 2023:
(:jsonrpc "2.0" :id 3 :method "textDocument/hover" :params
	  (:textDocument
	   (:uri "file:///home/thblt/temp/eglot-bug-rs/src/main.rs")
	   :position
	   (:line 0 :character 0)))
[client-request] (id:4) Sun Aug 20 15:31:43 2023:
(:jsonrpc "2.0" :id 4 :method "textDocument/documentHighlight" :params
	  (:textDocument
	   (:uri "file:///home/thblt/temp/eglot-bug-rs/src/main.rs")
	   :position
	   (:line 0 :character 0)))
[client-request] (id:5) Sun Aug 20 15:31:43 2023:
(:jsonrpc "2.0" :id 5 :method "textDocument/signatureHelp" :params
	  (:textDocument
	   (:uri "file:///home/thblt/temp/eglot-bug-rs/src/main.rs")
	   :position
	   (:line 0 :character 0)))
[server-request] (id:6) Sun Aug 20 15:31:48 2023:
(:jsonrpc "2.0" :id 6 :method "window/workDoneProgress/create" :params
	  (:token "rustAnalyzer/Loading"))
[client-reply] (id:6) Sun Aug 20 15:31:48 2023:
(:jsonrpc "2.0" :id 6 :result nil)
[server-notification] Sun Aug 20 15:31:48 2023:
(:jsonrpc "2.0" :method "$/progress" :params
	  (:token "rustAnalyzer/Loading" :value
		  (:kind "begin" :title "Loading" :cancellable :json-false)))
[server-notification] Sun Aug 20 15:31:48 2023:
(:jsonrpc "2.0" :method "textDocument/publishDiagnostics" :params
	  (:uri "file:///home/thblt/temp/eglot-bug-rs/src/main.rs" :diagnostics
		[]
		:version 0))
[server-reply] (id:3) Sun Aug 20 15:31:48 2023:
(:jsonrpc "2.0" :id 3 :result
	  (:contents
	   (:kind "plaintext" :value "fn\n\n\nA function or function pointer.\n\nFunctions are the primary way code is executed within Rust. Function blocks, usually just called functions, can be defined in a variety of different places and be assigned many different attributes and modifiers.\n\nStandalone functions that just sit within a module not attached to anything else are common, but most functions will end up being inside impl blocks, either on another type itself, or as a trait impl for that type.\n\nfn standalone_function() {\n    // code\n}\n\npub fn public_thing(argument: bool) -> String {\n    // code\n    # \"\".to_string()\n}\n\nstruct Thing {\n    foo: i32,\n}\n\nimpl Thing {\n    pub fn new() -> Self {\n        Self {\n            foo: 42,\n        }\n    }\n}\n\nIn addition to presenting fixed types in the form of fn name(arg: type, ..) -> return_type, functions can also declare a list of type parameters along with trait bounds that they fall into.\n\nfn generic_function<T: Clone>(x: T) -> (T, T, T) {\n    (x.clone(), x.clone(), x.clone())\n}\n\nfn generic_where<T>(x: T) -> T\n    where T: std::ops::Add<Output = T> + Copy\n{\n    x + x + x\n}\n\nDeclaring trait bounds in the angle brackets is functionally identical to using a where clause. It's up to the programmer to decide which works better in each situation, but where tends to be better when things get longer than one line.\n\nAlong with being made public via pub, fn can also have an extern added for use in FFI.\n\nFor more information on the various types of functions and how they're used, consult the Rust book or the Reference.")
	   :range
	   (:start
	    (:line 0 :character 0)
	    :end
	    (:line 0 :character 2))))
[server-reply] (id:4) Sun Aug 20 15:31:48 2023:
(:jsonrpc "2.0" :id 4 :result
	  [])
[server-reply] (id:5) Sun Aug 20 15:31:48 2023:
(:jsonrpc "2.0" :id 5 :result nil)
[server-notification] Sun Aug 20 15:31:49 2023:
(:jsonrpc "2.0" :method "$/progress" :params
	  (:token "rustAnalyzer/Loading" :value
		  (:kind "report" :cancellable :json-false :message "building proc-macros: eldoc-bug-rs")))
[server-notification] Sun Aug 20 15:31:49 2023:
(:jsonrpc "2.0" :method "$/progress" :params
	  (:token "rustAnalyzer/Loading" :value
		  (:kind "report" :cancellable :json-false :message "building proc-macros: eldoc-bug-rs")))
[server-request] (id:7) Sun Aug 20 15:31:49 2023:
(:jsonrpc "2.0" :id 7 :method "client/registerCapability" :params
	  (:registrations
	   [(:id "workspace/didChangeWatchedFiles" :method "workspace/didChangeWatchedFiles" :registerOptions
		 (:watchers
		  [(:globPattern "/home/thblt/temp/eglot-bug-rs/**/*.rs")
		   (:globPattern "/home/thblt/temp/eglot-bug-rs/**/Cargo.toml")
		   (:globPattern "/home/thblt/temp/eglot-bug-rs/**/Cargo.lock")]))]))
[client-reply] (id:7) Sun Aug 20 15:31:49 2023:
(:jsonrpc "2.0" :id 7 :result nil)
[server-notification] Sun Aug 20 15:31:49 2023:
(:jsonrpc "2.0" :method "$/progress" :params
	  (:token "rustAnalyzer/Loading" :value
		  (:kind "end")))
[server-request] (id:8) Sun Aug 20 15:31:49 2023:
(:jsonrpc "2.0" :id 8 :method "window/workDoneProgress/create" :params
	  (:token "rustAnalyzer/Roots Scanned"))
[client-reply] (id:8) Sun Aug 20 15:31:49 2023:
(:jsonrpc "2.0" :id 8 :result nil)
[server-notification] Sun Aug 20 15:31:49 2023:
(:jsonrpc "2.0" :method "$/progress" :params
	  (:token "rustAnalyzer/Roots Scanned" :value
		  (:kind "begin" :title "Roots Scanned" :cancellable :json-false :message "0/2" :percentage 0)))
[server-notification] Sun Aug 20 15:31:49 2023:
(:jsonrpc "2.0" :method "$/progress" :params
	  (:token "rustAnalyzer/Roots Scanned" :value
		  (:kind "report" :cancellable :json-false :message "1/2" :percentage 50)))
[server-notification] Sun Aug 20 15:31:49 2023:
(:jsonrpc "2.0" :method "$/progress" :params
	  (:token "rustAnalyzer/Roots Scanned" :value
		  (:kind "end" :message "2/2")))
[server-request] (id:9) Sun Aug 20 15:31:49 2023:
(:jsonrpc "2.0" :id 9 :method "window/workDoneProgress/create" :params
	  (:token "rustAnalyzer/Indexing"))
[client-reply] (id:9) Sun Aug 20 15:31:49 2023:
(:jsonrpc "2.0" :id 9 :result nil)
[server-notification] Sun Aug 20 15:31:49 2023:
(:jsonrpc "2.0" :method "$/progress" :params
	  (:token "rustAnalyzer/Indexing" :value
		  (:kind "begin" :title "Indexing" :cancellable :json-false :percentage 0)))
[server-notification] Sun Aug 20 15:31:49 2023:
(:jsonrpc "2.0" :method "$/progress" :params
	  (:token "rustAnalyzer/Indexing" :value
		  (:kind "report" :cancellable :json-false :message "0/5 (core + 1 more)" :percentage 0)))
[server-notification] Sun Aug 20 15:31:49 2023:
(:jsonrpc "2.0" :method "$/progress" :params
	  (:token "rustAnalyzer/Indexing" :value
		  (:kind "report" :cancellable :json-false :message "1/5 (core)" :percentage 20)))
[server-request] (id:10) Sun Aug 20 15:31:49 2023:
(:jsonrpc "2.0" :id 10 :method "window/workDoneProgress/create" :params
	  (:token "rust-analyzer/flycheck/0"))
[client-reply] (id:10) Sun Aug 20 15:31:49 2023:
(:jsonrpc "2.0" :id 10 :result nil)
[server-notification] Sun Aug 20 15:31:49 2023:
(:jsonrpc "2.0" :method "$/progress" :params
	  (:token "rust-analyzer/flycheck/0" :value
		  (:kind "begin" :title "cargo check" :cancellable t)))
[server-notification] Sun Aug 20 15:31:49 2023:
(:jsonrpc "2.0" :method "$/progress" :params
	  (:token "rust-analyzer/flycheck/0" :value
		  (:kind "end")))
[server-notification] Sun Aug 20 15:31:49 2023:
(:jsonrpc "2.0" :method "$/progress" :params
	  (:token "rustAnalyzer/Indexing" :value
		  (:kind "report" :cancellable :json-false :percentage 40)))
[server-notification] Sun Aug 20 15:31:49 2023:
(:jsonrpc "2.0" :method "$/progress" :params
	  (:token "rustAnalyzer/Indexing" :value
		  (:kind "report" :cancellable :json-false :message "2/5 (alloc)" :percentage 40)))
[server-notification] Sun Aug 20 15:31:49 2023:
(:jsonrpc "2.0" :method "$/progress" :params
	  (:token "rustAnalyzer/Indexing" :value
		  (:kind "report" :cancellable :json-false :percentage 60)))
[server-notification] Sun Aug 20 15:31:49 2023:
(:jsonrpc "2.0" :method "$/progress" :params
	  (:token "rustAnalyzer/Indexing" :value
		  (:kind "report" :cancellable :json-false :message "3/5 (std)" :percentage 60)))
[server-notification] Sun Aug 20 15:31:50 2023:
(:jsonrpc "2.0" :method "$/progress" :params
	  (:token "rustAnalyzer/Indexing" :value
		  (:kind "report" :cancellable :json-false :percentage 80)))
[server-notification] Sun Aug 20 15:31:50 2023:
(:jsonrpc "2.0" :method "$/progress" :params
	  (:token "rustAnalyzer/Indexing" :value
		  (:kind "report" :cancellable :json-false :message "4/5 (proc_macro)" :percentage 80)))
[server-notification] Sun Aug 20 15:31:50 2023:
(:jsonrpc "2.0" :method "$/progress" :params
	  (:token "rustAnalyzer/Indexing" :value
		  (:kind "report" :cancellable :json-false :percentage 100)))
[server-notification] Sun Aug 20 15:31:50 2023:
(:jsonrpc "2.0" :method "$/progress" :params
	  (:token "rustAnalyzer/Indexing" :value
		  (:kind "end")))
[client-request] (id:6) Sun Aug 20 15:31:52 2023:
(:jsonrpc "2.0" :id 6 :method "textDocument/hover" :params
	  (:textDocument
	   (:uri "file:///home/thblt/temp/eglot-bug-rs/src/main.rs")
	   :position
	   (:line 3 :character 0)))
[client-request] (id:7) Sun Aug 20 15:31:52 2023:
(:jsonrpc "2.0" :id 7 :method "textDocument/documentHighlight" :params
	  (:textDocument
	   (:uri "file:///home/thblt/temp/eglot-bug-rs/src/main.rs")
	   :position
	   (:line 3 :character 0)))
[client-request] (id:8) Sun Aug 20 15:31:52 2023:
(:jsonrpc "2.0" :id 8 :method "textDocument/signatureHelp" :params
	  (:textDocument
	   (:uri "file:///home/thblt/temp/eglot-bug-rs/src/main.rs")
	   :position
	   (:line 3 :character 0)))
[server-reply] (id:6) Sun Aug 20 15:31:52 2023:
(:jsonrpc "2.0" :id 6 :result nil)
[server-reply] (id:7) Sun Aug 20 15:31:52 2023:
(:jsonrpc "2.0" :id 7 :result nil)
[server-reply] (id:8) Sun Aug 20 15:31:52 2023:
(:jsonrpc "2.0" :id 8 :result nil)
[client-notification] Sun Aug 20 15:31:53 2023:
(:jsonrpc "2.0" :method "workspace/didChangeWatchedFiles" :params
	  (:changes
	   [(:uri "file:///home/thblt/temp/eglot-bug-rs/src/thblt@dru.21742%3A1692526210" :type 1)]))
[client-notification] Sun Aug 20 15:31:54 2023:
(:jsonrpc "2.0" :method "textDocument/didChange" :params
	  (:textDocument
	   (:uri "file:///home/thblt/temp/eglot-bug-rs/src/main.rs" :version 2)
	   :contentChanges
	   [(:range
	     (:start
	      (:line 3 :character 0)
	      :end
	      (:line 3 :character 0))
	     :rangeLength 0 :text " ")
	    (:range
	     (:start
	      (:line 3 :character 0)
	      :end
	      (:line 3 :character 1))
	     :rangeLength 1 :text "")]))
[client-notification] Sun Aug 20 15:31:54 2023:
(:jsonrpc "2.0" :method "textDocument/didSave" :params
	  (:text "fn main() {\n    let i = 3;\n    println!(\"{}\", i.baz);\n}\n" :textDocument
		 (:uri "file:///home/thblt/temp/eglot-bug-rs/src/main.rs")))
[client-notification] Sun Aug 20 15:31:54 2023:
(:jsonrpc "2.0" :method "workspace/didChangeWatchedFiles" :params
	  (:changes
	   [(:uri "file:///home/thblt/temp/eglot-bug-rs/src/main.rs" :type 1)]))
[client-notification] Sun Aug 20 15:31:54 2023:
(:jsonrpc "2.0" :method "workspace/didChangeWatchedFiles" :params
	  (:changes
	   [(:uri "file:///home/thblt/temp/eglot-bug-rs/src/main.rs" :type 2)]))
[client-notification] Sun Aug 20 15:31:54 2023:
(:jsonrpc "2.0" :method "workspace/didChangeWatchedFiles" :params
	  (:changes
	   [(:uri "file:///home/thblt/temp/eglot-bug-rs/src/.%23main.rs" :type 3)]))
[server-request] (id:11) Sun Aug 20 15:31:54 2023:
(:jsonrpc "2.0" :id 11 :method "window/workDoneProgress/create" :params
	  (:token "rust-analyzer/flycheck/0"))
[client-reply] (id:11) Sun Aug 20 15:31:54 2023:
(:jsonrpc "2.0" :id 11 :result nil)
[server-notification] Sun Aug 20 15:31:54 2023:
(:jsonrpc "2.0" :method "$/progress" :params
	  (:token "rust-analyzer/flycheck/0" :value
		  (:kind "begin" :title "cargo check" :cancellable t)))
[server-notification] Sun Aug 20 15:31:54 2023:
(:jsonrpc "2.0" :method "textDocument/publishDiagnostics" :params
	  (:uri "file:///home/thblt/temp/eglot-bug-rs/src/main.rs" :diagnostics
		[(:range
		  (:start
		   (:line 2 :character 21)
		   :end
		   (:line 2 :character 24))
		  :severity 1 :code "E0610" :codeDescription
		  (:href "https://doc.rust-lang.org/error-index.html#E0610")
		  :source "rustc" :message "`{integer}` is a primitive type and therefore doesn't have fields" :data
		  (:rendered "error[E0610]: `{integer}` is a primitive type and therefore doesn't have fields\n --> src/main.rs:3:22\n  |\n3 |     println!(\"{}\", i.baz);\n  |                      ^^^\n\n"))]
		:version 2))
[server-notification] Sun Aug 20 15:31:54 2023:
(:jsonrpc "2.0" :method "$/progress" :params
	  (:token "rust-analyzer/flycheck/0" :value
		  (:kind "end")))
[client-request] (id:9) Sun Aug 20 15:31:54 2023:
(:jsonrpc "2.0" :id 9 :method "textDocument/hover" :params
	  (:textDocument
	   (:uri "file:///home/thblt/temp/eglot-bug-rs/src/main.rs")
	   :position
	   (:line 3 :character 0)))
[client-request] (id:10) Sun Aug 20 15:31:54 2023:
(:jsonrpc "2.0" :id 10 :method "textDocument/documentHighlight" :params
	  (:textDocument
	   (:uri "file:///home/thblt/temp/eglot-bug-rs/src/main.rs")
	   :position
	   (:line 3 :character 0)))
[client-request] (id:11) Sun Aug 20 15:31:54 2023:
(:jsonrpc "2.0" :id 11 :method "textDocument/signatureHelp" :params
	  (:textDocument
	   (:uri "file:///home/thblt/temp/eglot-bug-rs/src/main.rs")
	   :position
	   (:line 3 :character 0)))
[server-reply] (id:9) Sun Aug 20 15:31:54 2023:
(:jsonrpc "2.0" :id 9 :result nil)
[server-reply] (id:10) Sun Aug 20 15:31:54 2023:
(:jsonrpc "2.0" :id 10 :result nil)
[server-reply] (id:11) Sun Aug 20 15:31:54 2023:
(:jsonrpc "2.0" :id 11 :result nil)
[client-notification] Sun Aug 20 15:32:00 2023:
(:jsonrpc "2.0" :method "workspace/didChangeWatchedFiles" :params
	  (:changes
	   [(:uri "file:///home/thblt/temp/eglot-bug-rs/src/thblt@dru.21742%3A1692526210" :type 1)]))
[client-notification] Sun Aug 20 15:32:01 2023:
(:jsonrpc "2.0" :method "textDocument/didChange" :params
	  (:textDocument
	   (:uri "file:///home/thblt/temp/eglot-bug-rs/src/main.rs" :version 3)
	   :contentChanges
	   [(:range
	     (:start
	      (:line 2 :character 20)
	      :end
	      (:line 2 :character 24))
	     :rangeLength 4 :text "")]))
[client-request] (id:12) Sun Aug 20 15:32:01 2023:
(:jsonrpc "2.0" :id 12 :method "textDocument/hover" :params
	  (:textDocument
	   (:uri "file:///home/thblt/temp/eglot-bug-rs/src/main.rs")
	   :position
	   (:line 2 :character 20)))
[client-request] (id:13) Sun Aug 20 15:32:01 2023:
(:jsonrpc "2.0" :id 13 :method "textDocument/documentHighlight" :params
	  (:textDocument
	   (:uri "file:///home/thblt/temp/eglot-bug-rs/src/main.rs")
	   :position
	   (:line 2 :character 20)))
[client-request] (id:14) Sun Aug 20 15:32:01 2023:
(:jsonrpc "2.0" :id 14 :method "textDocument/signatureHelp" :params
	  (:textDocument
	   (:uri "file:///home/thblt/temp/eglot-bug-rs/src/main.rs")
	   :position
	   (:line 2 :character 20)))
[client-request] (id:15) Sun Aug 20 15:32:01 2023:
(:jsonrpc "2.0" :id 15 :method "textDocument/inlayHint" :params
	  (:textDocument
	   (:uri "file:///home/thblt/temp/eglot-bug-rs/src/main.rs")
	   :range
	   (:start
	    (:line 2 :character 0)
	    :end
	    (:line 4 :character 0))))
[server-reply] (id:12) Sun Aug 20 15:32:01 2023:
(:jsonrpc "2.0" :id 12 :result
	  (:contents
	   (:kind "plaintext" :value "let i: i32")
	   :range
	   (:start
	    (:line 2 :character 19)
	    :end
	    (:line 2 :character 20))))
[server-reply] (id:13) Sun Aug 20 15:32:01 2023:
(:jsonrpc "2.0" :id 13 :result
	  [(:range
	    (:start
	     (:line 2 :character 19)
	     :end
	     (:line 2 :character 20))
	    :kind 2)
	   (:range
	    (:start
	     (:line 1 :character 8)
	     :end
	     (:line 1 :character 9)))])
[server-reply] (id:15) Sun Aug 20 15:32:01 2023:
(:jsonrpc "2.0" :id 15 :result
	  [])
[server-reply] (id:14) Sun Aug 20 15:32:01 2023:
(:jsonrpc "2.0" :id 14 :result nil)
[client-notification] Sun Aug 20 15:32:04 2023:
(:jsonrpc "2.0" :method "textDocument/didSave" :params
	  (:text "fn main() {\n    let i = 3;\n    println!(\"{}\", i);\n}\n" :textDocument
		 (:uri "file:///home/thblt/temp/eglot-bug-rs/src/main.rs")))
[client-notification] Sun Aug 20 15:32:04 2023:
(:jsonrpc "2.0" :method "workspace/didChangeWatchedFiles" :params
	  (:changes
	   [(:uri "file:///home/thblt/temp/eglot-bug-rs/src/main.rs" :type 2)]))
[client-notification] Sun Aug 20 15:32:04 2023:
(:jsonrpc "2.0" :method "workspace/didChangeWatchedFiles" :params
	  (:changes
	   [(:uri "file:///home/thblt/temp/eglot-bug-rs/src/.%23main.rs" :type 3)]))
[server-request] (id:12) Sun Aug 20 15:32:04 2023:
(:jsonrpc "2.0" :id 12 :method "window/workDoneProgress/create" :params
	  (:token "rust-analyzer/flycheck/0"))
[client-reply] (id:12) Sun Aug 20 15:32:04 2023:
(:jsonrpc "2.0" :id 12 :result nil)
[server-notification] Sun Aug 20 15:32:04 2023:
(:jsonrpc "2.0" :method "$/progress" :params
	  (:token "rust-analyzer/flycheck/0" :value
		  (:kind "begin" :title "cargo check" :cancellable t)))
[server-notification] Sun Aug 20 15:32:04 2023:
(:jsonrpc "2.0" :method "textDocument/publishDiagnostics" :params
	  (:uri "file:///home/thblt/temp/eglot-bug-rs/src/main.rs" :diagnostics
		[]
		:version 3))
[server-notification] Sun Aug 20 15:32:04 2023:
(:jsonrpc "2.0" :method "$/progress" :params
	  (:token "rust-analyzer/flycheck/0" :value
		  (:kind "report" :cancellable t :message "eldoc-bug-rs")))
[server-notification] Sun Aug 20 15:32:04 2023:
(:jsonrpc "2.0" :method "$/progress" :params
	  (:token "rust-analyzer/flycheck/0" :value
		  (:kind "report" :cancellable t :message "eldoc-bug-rs")))
[server-notification] Sun Aug 20 15:32:04 2023:
(:jsonrpc "2.0" :method "$/progress" :params
	  (:token "rust-analyzer/flycheck/0" :value
		  (:kind "end")))
[client-request] (id:16) Sun Aug 20 15:32:05 2023:
(:jsonrpc "2.0" :id 16 :method "textDocument/hover" :params
	  (:textDocument
	   (:uri "file:///home/thblt/temp/eglot-bug-rs/src/main.rs")
	   :position
	   (:line 2 :character 20)))
[client-request] (id:17) Sun Aug 20 15:32:05 2023:
(:jsonrpc "2.0" :id 17 :method "textDocument/documentHighlight" :params
	  (:textDocument
	   (:uri "file:///home/thblt/temp/eglot-bug-rs/src/main.rs")
	   :position
	   (:line 2 :character 20)))
[client-request] (id:18) Sun Aug 20 15:32:05 2023:
(:jsonrpc "2.0" :id 18 :method "textDocument/signatureHelp" :params
	  (:textDocument
	   (:uri "file:///home/thblt/temp/eglot-bug-rs/src/main.rs")
	   :position
	   (:line 2 :character 20)))
[server-reply] (id:16) Sun Aug 20 15:32:05 2023:
(:jsonrpc "2.0" :id 16 :result
	  (:contents
	   (:kind "plaintext" :value "let i: i32")
	   :range
	   (:start
	    (:line 2 :character 19)
	    :end
	    (:line 2 :character 20))))
[server-reply] (id:17) Sun Aug 20 15:32:05 2023:
(:jsonrpc "2.0" :id 17 :result
	  [(:range
	    (:start
	     (:line 2 :character 19)
	     :end
	     (:line 2 :character 20))
	    :kind 2)
	   (:range
	    (:start
	     (:line 1 :character 8)
	     :end
	     (:line 1 :character 9)))])
[server-reply] (id:18) Sun Aug 20 15:32:05 2023:
(:jsonrpc "2.0" :id 18 :result nil)

OK, I tried to reproduce with a C source file and clangd, and couldn't, so the issue may be with rust-analyzer. NeoVim behaves exactly the same as Emacs here with the same Rust file (It originally didn't, because I forgot to disable an autosave plugin…). Closing for now, sorry for the noise, will reopen if anything can be done on eglot side.