monaco-editor icon indicating copy to clipboard operation
monaco-editor copied to clipboard

[Bug] After monaco >= 0.40.0, it show quick rather than quick fix for action provider

Open BeishaoCao-db opened this issue 2 years ago • 2 comments

Reproducible in vscode.dev or in VS Code Desktop?

  • [X] 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.43.0#XQAAAAJtBAAAAAAAAABBqQkHQ5NjdMjwa-jY7SIQ9S7DNlzs5W-mwj0fe1ZCDRFc9ws9XQE0SJE1jc2VKxhaLFIw9vEWSxW3yscw6obbnbpo6KbyT6d2s9ZojPnuzKxfrOqkauMGuyn80RiA_W6BftmfFae8xvpkVeIw3aOBUMjdJAGWyoIhZHjezYznzT4coJSyV7KeAJrWM9W9S0QZ-wsF-mz6k8WYpL3JvElJHPtgq_VGzNRbBnSRh64Bq4fJC_9Yk17H2fCEgrlDrXHUk631jg7C8BohViAnt7q-EESHLp1qmkKNbpsk3wFZS26kB_EbHLWSZLtzhHlUBz0-56hP1UgTZ923NlXr_8gxzCiO6XNC7TE4EMnS4Be-BI29g2h7rF93HWaHyTizs4tGS5MyBnWOdlMfW-LS5GEQT3swrg-p8lCKtdzqDCS6SHAvsxAdTxOVGGDcpkJrAudDNcsDPgdGMRMH2-Dk3w5Z43hL2LSvOespecj9nDcBMBC9HSaHjBa0X8_ZctzW4WZwU9ZS9TZivRe8iICOwwE0YTjZSMeoAYwPLNch9APdDilg1bj9rhZ0Y5blszwrXcuM44dPImCBZW8yzZXahDfV74heeRNZyy3MVv6y0SLV0KNVAHMzzloPHyGmm-wQdPfft0J51ZGbZNBmgsTmrk0lFR3FQz99PZKsi-Z-dXx5_a3_cJMM36vQyT0_aRQt-BzwG1KUKCjiztVdT8PXsrg3KKGxfSIYUAs9P-9zSRFO7ajfU3ZaEqVTgs1QU-Q0Npcsrv_RRmEj

Monaco Editor Playground Code

monaco.languages.register({ id: 'myLanguage' });

monaco.editor.onDidCreateModel(function(model) {
    function validate() {
      var textToValidate = model.getValue();
      
      var markers = [{
        severity: monaco.MarkerSeverity.Error,
        startLineNumber: 1,
        startColumn: 3,
        endLineNumber: 1,
        endColumn: 5,
        message: 'Lets correct it'
      }];
      monaco.editor.setModelMarkers(model, 'myLanguage', markers);
    }

    var handle = null;
    model.onDidChangeContent(() => {
      // debounce
      clearTimeout(handle);
      handle = setTimeout(() => validate(), 500);
    });
    validate();
});

monaco.languages.registerCodeActionProvider("myLanguage", {
    provideCodeActions: (model, range) => {
        
        return {
            actions: [{
				title: 'hi',
				kind: 'quickfix',
			}],
            dispose: () => {}
        }
    }
});

var ed = monaco.editor.create(document.getElementById("container"), {
    value: "cont foo = 1;",
    language: "myLanguage",
    lightbulb: { enabled: false },
});

Reproduction Steps

Seen in below video, just hover on the tokens with action provider

Actual (Problematic) Behavior

Show view & quick

Expected Behavior

show view problem & quick fix

Additional Context

https://github.com/microsoft/monaco-editor/assets/109033553/40ab122a-5b49-4cf5-8dc0-a8feb9f4a674

BeishaoCao-db avatar Nov 06 '23 17:11 BeishaoCao-db

Please do a bisect over the versions to find out the first nightly version in which this happened. I'm not sure this is a bug though and not by design.

hediet avatar Dec 13 '23 16:12 hediet

I believe https://github.com/microsoft/monaco-editor/issues/4314 is the same issue as this one

jkillian avatar Jan 25 '24 22:01 jkillian