vscode icon indicating copy to clipboard operation
vscode copied to clipboard

registerCodeLensProvider

Open 1684838553 opened this issue 1 year ago • 4 comments

Version: 1.95.3 (user setup) Commit: f1a4fb101478ce6ec82fe9627c43efbf9e98c813 Date: 2024-11-13T14:50:04.152Z Electron: 32.2.1 ElectronBuildId: 10427718 Chromium: 128.0.6613.186 Node.js: 20.18.0 V8: 12.8.374.38-electron.0 OS: Windows_NT x64 10.0.22631

Steps to Reproduce:

  1. Installing the register-codelens-provider extension. Please download the extension register-codelens-provider-0.0.1.vsix from https://github.com/1684838553/store.
  2. Open the Java file, activate the extension, and display the codelens. The editor starts from the third line of code. When you enter characters, the visible area of the editing area changes.

Image

The top of the editing page is displayed from the third line. This problem can be reproduced only after codelens is hidden.

1684838553 avatar Dec 06 '24 08:12 1684838553

Are you able to publish the source of that extension, ideally as a GH repo? I for one am unwilling to install it as a prebuilt VSIX.

gjsjohnmurray avatar Dec 06 '24 08:12 gjsjohnmurray

https://github.com/1684838553/store Image Uploaded. The source code of the extension is in the registerCodelensProvider directory.

1684838553 avatar Dec 06 '24 09:12 1684838553

Hi, you want the source code I have submitted, please look at the need for other? @gjsjohnmurray

1684838553 avatar Dec 17 '24 08:12 1684838553

Hey @jrieken, this issue might need further attention.

@1684838553, you can help us out by closing this issue if the problem no longer exists, or adding more information.

@jrieken,这个问题可能需要进一步关注。

@1684838553,如果问题不再存在,您可以关闭此问题,或者添加更多信息来帮助我们。

The problem still exists in version 1.98.1. What more information do you need?

1684838553 avatar Mar 11 '25 08:03 1684838553

I took a brief look at your code. Why are you using a vscode.workspace.onDidChangeTextDocument event handler to call your own provideCodeLenses method? I think it is VS Code's responsibility to call your method.

gjsjohnmurray avatar Mar 11 '25 08:03 gjsjohnmurray

I took a brief look at your code. Why are you using a vscode.workspace.onDidChangeTextDocument event handler to call your own provideCodeLenses method? I think it is VS Code's responsibility to call your method.

I need to simulate a scenario, check the file and modify it, and re-register the location of codelens. Or, in this case, you have a better way to do it.

1684838553 avatar Mar 13 '25 08:03 1684838553

I need to simulate a scenario, check the file and modify it, and re-register the location of codelens. Or, in this case, you have a better way to do it.

How are you making the file modifications? I would have expected VS Code to detect the changes and automatically re-request codelenses when necessary.

If you want to obtain the CodeLens instances for a text document, including the codelenses your own CodeLensProvider supplies, I suggest you use the vscode.executeCodeLensProvider built-in command.

gjsjohnmurray avatar Mar 13 '25 09:03 gjsjohnmurray

closing this as question, the discussion may continue but this isn't an issue with VS Code

jrieken avatar Mar 13 '25 10:03 jrieken