File tree Expand file tree Collapse file tree 3 files changed +30
-9
lines changed Expand file tree Collapse file tree 3 files changed +30
-9
lines changed Original file line number Diff line number Diff line change @@ -21,13 +21,13 @@ If it is not possible to specify remote styles with `<link rel="stylesheet">` ta
2121
2222## Supported Languages
2323
24- Support for other types of html like documents can be added in VS Code settings:
24+ Supported languages can be configured with the ` css.enabledLanguages ` configuration setting. By
25+ default "html" is enabled:
2526
2627``` json
27- "files.associations" : {
28- "*.tpl" : " html" ,
29- "*.master" : " html"
30- }
28+ "css.enabledLanguages" : [
29+ " html"
30+ ]
3131```
3232
3333## Installation
Original file line number Diff line number Diff line change 22 "name" : " vscode-html-css" ,
33 "displayName" : " HTML CSS Support" ,
44 "description" : " CSS support for HTML documents" ,
5- "version" : " 1.0.1 " ,
5+ "version" : " 1.0.2 " ,
66 "publisher" : " ecmel" ,
77 "license" : " MIT" ,
88 "homepage" : " https://github.com/ecmel/vscode-html-css" ,
2626 " multi-root ready"
2727 ],
2828 "activationEvents" : [
29- " onLanguage:html "
29+ " onStartupFinished "
3030 ],
3131 "contributes" : {
3232 "configuration" : {
3737 "default" : [],
3838 "description" : " A list of remote style sheets." ,
3939 "scope" : " resource"
40+ },
41+ "css.enabledLanguages" : {
42+ "type" : " array" ,
43+ "description" : " A list of languages where suggestions are desired." ,
44+ "default" : [
45+ " html"
46+ ],
47+ "scope" : " window"
48+ },
49+ "css.triggerCharacters" : {
50+ "type" : " array" ,
51+ "description" : " A list of trigger characters to start completion." ,
52+ "default" : [
53+ " \" " ,
54+ " '"
55+ ],
56+ "scope" : " window"
4057 }
4158 }
4259 }
Original file line number Diff line number Diff line change @@ -168,9 +168,13 @@ export class ClassCompletionItemProvider implements CompletionItemProvider {
168168}
169169
170170export function activate ( context : ExtensionContext ) {
171+ const config = workspace . getConfiguration ( "css" ) ;
172+ const enabledLanguages = config . get < string [ ] > ( "enabledLanguages" , [ "html" ] ) ;
173+ const triggerCharacters = config . get < string [ ] > ( "triggerCharacters" , [ "\"" , "'" ] ) ;
174+
171175 context . subscriptions . push ( languages
172- . registerCompletionItemProvider ( "html" ,
173- new ClassCompletionItemProvider ( ) , "\"" , "'" ) ) ;
176+ . registerCompletionItemProvider ( enabledLanguages ,
177+ new ClassCompletionItemProvider ( ) , ... triggerCharacters ) ) ;
174178}
175179
176180export function deactivate ( ) { }
You can’t perform that action at this time.
0 commit comments