Skip to content
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

[Bug] CodeLens. range.startColumn not take effect #4792

Open
1 of 2 tasks
Blankll opened this issue Dec 24, 2024 · 0 comments
Open
1 of 2 tasks

[Bug] CodeLens. range.startColumn not take effect #4792

Blankll opened this issue Dec 24, 2024 · 0 comments

Comments

@Blankll
Copy link

Blankll commented Dec 24, 2024

Reproducible in vscode.dev or in VS Code Desktop?

  • Not reproducible in vscode.dev or VS Code Desktop

Reproducible in the monaco editor playground?

Monaco Editor Playground Link

https://microsoft.github.io/monaco-editor/playground.html?source=v0.52.2#XQAAAAIvAwAAAAAAAABBqQkHQ5NjdMjwa-jY7SIQ9S7DNlzs5W-mwj0fe1ZCDRFc9ws9XQE0SJE1jc2VKxhaLFIw9vEWSxW3yscw3BkLADpQaK_EVxFniLUT0SQgPlzliH97pkRAgqY-pGy1EUKJUtY8TRUmTb5Nv2OAWrVMNWWsQvVxkbZkfoWl-YM4vfrpI4r7l8k7D7lPN0a4Q4aHdfER88KoI_exp4n5HqZQIbF5MIgSb-6jSO9yCBnFpkcrmI08zCrS9x-L3WaQoghta4cP66K82e6H_J1EpUVtF-OZ3NFTfpYIBoig-tbvh-1bTLeoQQQlklT8aWpm1BohrZZSBJmjBeTgMdBIgDoempHmohBsyq8Of-OE4W_k2V45Yj_WXf0ElwaXYo2fQilwni0XSSAralyr3PwJ_wtzUXMGx2tbMWQMqWxzWDs0TG6E8enXET_orZn39zcWCP-OwWq5b60aopJlu9RmvGkrI3pSiRBvosz0JweYPb0gkMOekLcX6KnxHtpPwobD8Tq_EL0e25H-hExamsVn3mH-6gMaXT0JGgAt77onz74T-fdu3xP7tKodwDtzBsPRM9I-wC3mOZiN9prradYXcSyGuKg7Mnh3kp5HUDh55fBRfD1X_-ea2R8

Monaco Editor Playground Code

var editor = monaco.editor.create(document.getElementById("container"), {
	value: '{\n\t"dependencies": {\n\t\t\n\t}\n}\n',
	language: "json",
});

var commandId = editor.addCommand(
	0,
	function () {
		// services available in `ctx`
		alert("my command is executing!");
	},
	""
);

monaco.languages.registerCodeLensProvider("json", {
	provideCodeLenses: function (model, token) {
		return {
			lenses: [
				{
					range: {
						startLineNumber: 1,
						startColumn: 10,
						endLineNumber: 1,
						endColumn: 20,
					},
					id: "First Line",
					command: {
						id: commandId,
						title: "First Line",
					},
				},
			],
			dispose: () => {},
		};
	},
	resolveCodeLens: function (model, codeLens, token) {
		return codeLens;
	},
});

Reproduction Steps

  1. open the link
  2. past the code

Actual (Problematic) Behavior

the codelens always displays on the left top of the specified line, the endLineNumber, startColumn and endColumn do not take effect

Expected Behavior

I suppose it should be able to create inline codelens by specifying the startlinlNumber equal to endLineNumber and endColumn as content lens,

Additional Context

No response

@Blankll Blankll changed the title [Bug] CodeLens. range.startColumn not take affect [Bug] CodeLens. range.startColumn not take effect Dec 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant