-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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
make dataproviders or languageservices accessible for customdata #2284
Comments
cc @aeschli |
Help is wanted here. If you have a interest, I'm happy to accept a PR. I guess it would be done as a new html option: https://github.com/microsoft/monaco-html/blob/f1754a3b261f92ca906a4a3a7fb81474254e24b3/monaco.d.ts#L26 |
added new APIs to the css and html supports. const data = {
"version": 1.1,
"properties": [
{ "name": "foo", "description": "Foo property" }
],
"atDirectives": [
{ "name": "@foo", "description": "Foo at directive" }
],
"pseudoClasses": [
{ "name": ":foo", "description": "Foo pseudo class" }
],
"pseudoElements": [
{ "name": "::foo", "description": "Foo pseudo elements" }
]
}
monaco.languages.css.cssDefaults.setOptions({data: { useDefaultDataProvider: false, dataProviders: [ data ]}}); const data = {
"version": 1.1,
"tags": [
{
"name": "foo",
"description": "The foo element",
"attributes": [
{ "name": "bar" },
{
"name": "baz",
"values": [
{
"name": "baz-val-1"
}
]
}
]
}
],
"globalAttributes": [
{ "name": "fooAttr", "description": "Foo Attribute" },
{ "name": "xattr", "description": "X attributes", "valueSet": "x" }
],
"valueSets": [
{
"name": "x",
"values": [
{
"name": "xval",
"description": "x value"
}
]
}
]
}
monaco.languages.html.htmlDefaults.setOptions({data: { useDefaultDataProvider: false, dataProviders: [ data ]}}); More information on the data format: |
I want to add two fields 1 the name here is the label and we want to put an insertText in there. For example, I think an insert with a tag that has several attributes would need to do this. 2 I think properties and events should be distinguished so that they have different signs of kind So I think there should be an event as well as an attribute |
1 similar comment
I want to add two fields 1 the name here is the label and we want to put an insertText in there. For example, I think an insert with a tag that has several attributes would need to do this. 2 I think properties and events should be distinguished so that they have different signs of kind So I think there should be an event as well as an attribute |
@y912765390 feature requests for custom data would have to go against https://github.com/microsoft/vscode-custom-data (which defines the data format) and the https://github.com/microsoft/vscode-html-languageservice, which consumes the daa and creates proposals with labels etc. |
background
custom data allows to extend language services in a clever way.
use case
My use case is to generate custom data for web components via wca and provide an live documentation.
vscode reference
In vscode i can instruct the HTML and CSS langugage services to use custom data via simple configuation.
possible implementations
Monaco uses the same language service but does not expose the needed functionality.
(i.e.
htmlLanguageService.setDataProviders( newHTMLDataProvider("hello",myCustomData))
)Please either add custom data to the configuration options or provide a way to access the language service from outside.
demo (stolen from vscode)
The text was updated successfully, but these errors were encountered: