-
-
Notifications
You must be signed in to change notification settings - Fork 177
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
Do not request "textDocument/documentSymbol" when content changed #209
Comments
To do so, you'll need a more recent version of monaco editor I opened a PR (#207) to update to monaco 20.0.0 but I didn't implement registerDocumentSemanticTokensProvider and registerDocumentRangeSemanticTokensProvider (they are binded to |
Good news. Wish that comes soon! |
Even if you hook up the semantic tokens provider, you won't get any colouring support because of microsoft/monaco-editor#1833. |
I just updated my PR to implement the new semantic token API, and I managed to make it work on the docker lsp (https://github.com/rcjsuen/dockerfile-language-server-nodejs) which is the only implementation for the moment What you need to do is:
import { StaticServices } from 'monaco-editor/esm/vs/editor/standalone/browser/standaloneServices'
StaticServices.configurationService.get().updateValue('editor.semanticHighlighting', {
enabled: true
});
import { StaticServices } from 'monaco-editor/esm/vs/editor/standalone/browser/standaloneServices'
const ThemeClass = StaticServices.standaloneThemeService.get()._theme.constructor;
interface ITokenStyle {
readonly foreground?: number;
readonly bold?: boolean;
readonly underline?: boolean;
readonly italic?: boolean;
}
ThemeClass.prototype.getTokenStyleMetadata = function (type: string, modifiers: string[], modelLanguage: string): ITokenStyle {
// whatever you want based on the type and the modifier
return {
foreground: this.tokenTheme._colorMap.getId('#ff0000'),
bold: true
};
} (The last parameter (
const client = new MonacoLanguageClient({ ... })
client.registerProposedFeatures() |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
Want to implement "Semantic Coloring" by the monaco-languageclient and LSP server.
But I find it does not request "textDocument/documentSymbol".
Desperately want to know whether the function is available? How to open it? Or are there any documents on this?
The text was updated successfully, but these errors were encountered: