provideSelectionRanges is not invoked when user select a token by double clicking on it
See original GitHub issueI need to override something related to token selection and i encounter provideSelectionRanges.
provideSelectionRanges
is not invoked when we select a token by double clicking on it.
Please see the code snippet below
`
monaco.languages.register({ id: 'mySpecialLanguage' });
monaco.languages.registerSelectionRangeProvider('mySpecialLanguage', {
provideSelectionRanges: function (model, positions, token) {
console.log('i am provideSelectionRanges');
const position = positions[0];
const word = model.getWordAtPosition(position);
console.log('selection range provider word is: ', word);
return null
}
});
monaco.editor.create(document.getElementById("container"), {
value: '\n\nHover over this text',
language: 'mySpecialLanguage'
});
` What am i doing wrong or is there any another provider which will help me override things related to token selections.
Issue Analytics
- State:
- Created 2 years ago
- Reactions:1
- Comments:6 (3 by maintainers)
Top Results From Across the Web
ISelection - ngx-monaco-editor-demo documentation
To not automatically create a model, use `model: null`. ... Should the corresponding line be selected when clicking on the line number? *...
Read more >VS Code API | Visual Studio Code Extension API
VS Code API is a set of JavaScript APIs that you can invoke in your Visual Studio Code extension. This page lists all...
Read more >Can't Double-Click : r/FoundryVTT - Reddit
So you have to click once to select the token, then double click it to open the sheet.
Read more >monaco-editor - UNPKG
CancellationToken ); ... Therefore `Uri#fsPath` exists - it's sugar to ease working ... 1066, * To not create automatically a model, use `model:...
Read more >https://raw.githubusercontent.com/Microsoft/vscode...
*Note* that * this does not mean the document will be saved to disk, use ... An optional function that is invoked whenever...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@abhishekthakurak You can listen to selection changes and then change the editor’s selection to be something else using
editor.setSelection
. This method is documented at https://microsoft.github.io/monaco-editor/api/index.html and is available in the editor’s.d.ts
files.@alexdima i think this will work thanks for the answer