question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

codeLens resolve request not work

See original GitHub issue

I have try onCodeLensResolve() and onRequest('codeLens/resolve'), behaves like not registered.

When I force the trigger it will throw:

(node:97732) UnhandledPromiseRejectionWarning: Error: Request client/registerCapability failed with message: No feature implementation for codeLens/resolve found. Registration failed.
    at handleResponse (/***/node_modules/vscode-jsonrpc/lib/main.js:449:48)
    at processMessageQueue (/***/node_modules/vscode-jsonrpc/lib/main.js:276:17)
    at Immediate.<anonymous> (/***/node_modules/vscode-jsonrpc/lib/main.js:260:13)
    at processImmediate (internal/timers.js:439:21)
(node:97732) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 2)
(node:97732) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
[Info  - 1:53:16 PM] Registering request handler for codeLens/resolve failed.

Reproduce: https://github.com/johnsoncodehk/vscode-extension-samples/tree/codeLens-resolve-bug/lsp-sample

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:22 (12 by maintainers)

github_iconTop GitHub Comments

1reaction
dbaeumercommented, Nov 23, 2020

Change this

connection.onCodeLens(
	(_textDocumentPosition: CodeLensParams): CodeLens[] => {
		// The pass parameter contains the position of the text document in
		// which code complete got requested. For the example we ignore this
		// info and always provide the same completion items.
		return [
			{
				range: Range.create(0, 0, 0, 0),
				command: {
					title: 'not resolve',
					command: ''
				}
			}
		];
	}
);

too

connection.onCodeLens(
	(_textDocumentPosition: CodeLensParams): CodeLens[] => {
		// The pass parameter contains the position of the text document in
		// which code complete got requested. For the example we ignore this
		// info and always provide the same completion items.
		return [
			{
				range: Range.create(0, 0, 0, 0)
			}
		];
	}
);

1reaction
dbaeumercommented, Nov 23, 2020

Actually there seems to be something missing here. Let me investigate.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Request codeLens/resolve failed · Issue #1893 - GitHub
Yes. Specifically, I have this issue when I add a dir with a rust project into non-rust workspace and then navigate a rust...
Read more >
CodeLens not working - Visual Studio Feedback
This issue was caused by a problem with the way Visual Studio IntelliCode Refactorings preview feature was loaded. A fix is available in...
Read more >
CodeLens not showing references - visual studio
Go to Tools -> Options -> Text Editor -> All Languages -> CodeLens then click the "Enable CodeLens" option if it is not...
Read more >
StackOverflowException causes crash in TFS 2013 Update 4 ...
Go to Tools > Options > Text Editor > All Languages > CodeLens. Note If the options in the Resolution and Workaround sections...
Read more >
D91930 [clangd] Implement textDocument/codeLens - LLVM
resolveCodeLens : This function implements the codeLens/resolve API. ... the text rendering will not look too weird during long-time request.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found