I have an extension installed to add custom handling of a HTML/CSS/JS environment that has custom features for the Sciter UI library. However, this extension requires me to associate the file types I want to use the custom sciter verions of things, such as:
"files.associations": {
"*.scs": "sciter-css",
"*.shtm": "sciter-html",
"*.shtml": "sciter-html"
},
While the majority of things are normal HTML, there are some special features that are added in the extensions language files.
Is there a way for me to use these custom associations but still have the ability to use the built-in / default HTML formatting when I tell VSCode to format the document? (Same for CSS, and JS.)
Edit:
Based on the information I'm hearing from you, you might be able to use the beautify extension with these settings in your user or workspace settings:
{
"beautify.language": {
"js": ["js", "json", "tiscript"]
"css": ["css", "scss", "sciter-css"],
"html": ["htm", "html", "sciter-html"]
// ^^ providing just an array sets the VS Code file type
}
}
End Edit
As a general answer, unfortunately no.
There can only be one active "language" for a document. Though there is a discussion here about allowing multiple languages.
The extension author either needs to add their features to the existing html, javascript, and CSS languages, or the developer themselves need to add the basic functionality for those languages.
Also, instead of using a language ID at all, the extension author could also provide functionality based on the file extensions directly and allow the user to provide a different set of file extensions in the settings if they need them.
Related
Currently, when I paste JSON into a new tab in VSCode, it will usually detect its Language Mode as something else (ex CoffeeScript, etc, etc). Usually these are languages that I never use and don't care about.
Can I restrict the list of possible languages that it auto-identifies, so that it has a better chance of realizing that what I pasted in was JSON?
The description of that setting, Workbench > Editor: Language Detection, says that it can be scoped to restrict which languages it is applied to:
// Controls whether the language in a text editor is automatically
detected unless the language has been explicitly set by the language
picker. This can also be scoped by language so you can specify which
languages you do not want to be switched off of. This is useful for
languages like Markdown that often contain other languages that might
trick language detection into thinking it's the embedded language and
not Markdown.
So you could try this setting (in your settings.json):
"[json, jsonc]": {
"workbench.editor.languageDetection": false
}
This may only apply to previously set json files so let me know if this makes any difference. I don't think there is any other option other than disabling all language detection - of which I assume you are aware.
i know vscode has custom snippet like this
{
"foo": {
"prefix": "foo",
"body": [
"<foo FIELD='${1|one,two,three|}'></foo>"
],
"description": "a custom html tag with special prop"
}
}
but in fact, that is not good enough, how to show every different attribute what is its meaning?
Is there anything not so difficult ways can i do that? i try TextMate or VSCode plugin its so hard for me.
If there is no, please just tell me, I will continue to try hard.
A late answer, but Custom Data Extension is what you're probably looking for.
Github Repo
Custom Data Extension
Blog Post with examples
You can create my-types.html-data.json and achieve full completion for custom tags and attributes, as well as potential values.
You can do this by either generating it dynamically with your custom extension or adding your custom VS Code settings.
There are many options to config stylelint, like
a stylelint property in package.json
.stylelintrc.json, .stylelintrc.yaml, .stylelintrc.js etc.
a stylelint.config.js file
Is there any difference when I'm deciding which one to use?
Official document says:"You may want to use an extension so that your text editor can better interpret the file, and help with syntax checking and highlighting."Any other difference except that?
Thanks!
stylelint uses cosmiconfig, all of the options you mention are made available through cosmiconfig.
So it's more about flexibility and offering that personal choice to stylelint users to choose a filename and format that they find most suitable.
Each of the formats are fully supported and have no other differences with different formats offering different functionality, they all support all of stylelints configuration options out of the box
Is it possible to create an extension with user interface for visual studio code.
I like to have an editor for a json file and I like to have some UI for it.
Like google chrome extensions with HTML/CSS/JAVASCRIPT.
Does VS Code supports these kind of extensions?
No, VSCode does not provide this level of extension integration. However, if you still plan to edit the JSON using the text editor, but want to "render" it in some way, that is possible. You can use a TextDocumentContentProvider to provide a read-only view of your JSON file. For a similar example, look at the CSS Properties Preview example extension.
I have modified the CQ’s rich text editor with the special char plugins. But the issue is, this includes the html source editing plugin also. I don’t want to include that in my rich text editor. Is there any way that I can include special chars but not html source editing. Basically i don’t want the html editing option in RTE.
The specialchars feature is made available through the misctools plugin which also contains the sourceedit feature.
In order to activate specific features of the plugin, the features property has to be a String[] with values of the specific feature you require as shown below.
"rtePlugins": {
"jcr:primaryType": "nt:unstructured",
"misctools": {
"jcr:primaryType": "nt:unstructured",
"features": ["sourceedit"]
}
}
In case you the features property is of type String and value is *, then it would include all the features of the plugin. Probably that is why you are getting sourceedit along with specialchars.
Configuring the Rich Text Editor might help you understand more on using the rich text editor in AEM. Also refer the API documentation for the MiscToolsPlugin.