import { LanguageService as CSSLanguageService } from 'vscode-css-languageservice' ; import { HTMLDocumentRegions } from '../embeddedSupport' ; import { LanguageModelCache } from '../languageModelCache' ; import { LanguageMode , Position } from '../languageModes' ; import { TextDocument } from 'vscode-languageserver-textdocument' ; export function getCSSMode ( cssLanguageService , documentRegions ) { return { getId ( ) { return 'css' ; } , doValidation ( document ) { const embedded = documentRegions . get ( document ) . getEmbeddedDocument ( 'css' ) ; const stylesheet = cssLanguageService . parseStylesheet ( embedded ) ; return cssLanguageService . doValidation ( embedded , stylesheet ) ; } , doComplete ( document , position ) { const embedded = documentRegions . get ( document ) . getEmbeddedDocument ( 'css' ) ; const stylesheet = cssLanguageService . parseStylesheet ( embedded ) ; return cssLanguageService . doComplete ( embedded , position , stylesheet ) ; } , onDocumentRemoved ( _document ) { } , dispose ( ) { } } ; }