mirror of
https://github.com/microsoft/vscode.git
synced 2026-04-20 00:28:52 +01:00
Update html-language-features to use doQuoteComplete
This commit is contained in:
@@ -55,6 +55,18 @@ export function getHTMLMode(htmlLanguageService: HTMLLanguageService, workspace:
|
||||
async getFoldingRanges(document: TextDocument): Promise<FoldingRange[]> {
|
||||
return htmlLanguageService.getFoldingRanges(document);
|
||||
},
|
||||
async doAutoQuote(document: TextDocument, position: Position, settings = workspace.settings) {
|
||||
const htmlSettings = settings?.html;
|
||||
const options = merge(htmlSettings?.suggest, {});
|
||||
options.attributeDefaultValue = htmlSettings?.completion?.attributeDefaultValue ?? 'doublequotes';
|
||||
|
||||
const offset = document.offsetAt(position);
|
||||
const text = document.getText();
|
||||
if (offset > 0 && text.charAt(offset - 1) === '=') {
|
||||
return htmlLanguageService.doQuoteComplete(document, position, htmlDocuments.get(document), options);
|
||||
}
|
||||
return null;
|
||||
},
|
||||
async doAutoClose(document: TextDocument, position: Position) {
|
||||
const offset = document.offsetAt(position);
|
||||
const text = document.getText();
|
||||
|
||||
Reference in New Issue
Block a user