本文整理汇总了TypeScript中vscode-languageserver.TextDocuments.all方法的典型用法代码示例。如果您正苦于以下问题:TypeScript TextDocuments.all方法的具体用法?TypeScript TextDocuments.all怎么用?TypeScript TextDocuments.all使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类vscode-languageserver.TextDocuments
的用法示例。
在下文中一共展示了TextDocuments.all方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1:
connection.onDidChangeConfiguration(change => {
config = change.settings;
vls.configure(config);
// Update formatting setting
documents.all().forEach(triggerValidation);
});
示例2: if
connection.onDidChangeConfiguration((change) => {
globalSettings = change.settings;
documentSettings = {}; // reset all document settings
languageModes.getAllModes().forEach(m => {
if (m.configure) {
m.configure(change.settings);
}
});
documents.all().forEach(triggerValidation);
// dynamically enable & disable the formatter
if (clientDynamicRegisterSupport) {
let enableFormatter = globalSettings && globalSettings.html && globalSettings.html.format && globalSettings.html.format.enable;
if (enableFormatter) {
if (!formatterRegistration) {
let documentSelector: DocumentSelector = [{ language: 'html' }, { language: 'handlebars' }]; // don't register razor, the formatter does more harm than good
formatterRegistration = connection.client.register(DocumentRangeFormattingRequest.type, { documentSelector });
}
} else if (formatterRegistration) {
formatterRegistration.then(r => r.dispose());
formatterRegistration = null;
}
}
});
示例3:
connection.onDidChangeConfiguration((change) => {
languageModes.getAllModes().forEach(m => {
if (m.configure) {
m.configure(change.settings);
}
});
documents.all().forEach(triggerValidation);
});
示例4: validateMany
connection.onDidChangeWatchedFiles(() => {
configWatcherStatus = true;
if (!configResolver) {
return;
}
validateMany(allDocuments.all());
});
示例5: annotateWithVersionMap
private async annotateWithVersionMap(promise: Promise<Analysis>) {
const versionMap = new Map<string, number>();
for (const document of this.documents.all()) {
versionMap.set(document.uri, document.version);
}
const analysis = await promise;
this.analysisVersionMap.set(analysis, versionMap);
return analysis;
}
示例6: validateAllTextDocuments
connection.onDidChangeConfiguration(async (params) => {
globalSettings = params.settings;
// Clear cache.
configPathCache = {};
settingsCache.flush();
// Revalidate any open text documents.
await validateAllTextDocuments(documents.all());
});
示例7:
connection.onDidChangeConfiguration((change) => {
settings = change.settings;
let validationSettings = settings && settings.html && settings.html.validate || {};
validation.css = validationSettings.styles !== false;
validation.javascript = validationSettings.scripts !== false;
languageModes.getAllModes().forEach(m => {
if (m.configure) {
m.configure(change.settings);
}
});
documents.all().forEach(triggerValidation);
});
示例8:
connection.onDidChangeConfiguration((change) => {
const apiElementsSettings: ApiElementsSettings = change.settings.apiElements;
currentSettings = lodash.cloneDeep(apiElementsSettings);
debouncedValidateTextDocument = lodash.debounce(validateTextDocument, apiElementsSettings.validation.debounce);
const desideredSymbolNames =
Object.keys(apiElementsSettings.symbols).filter((sym) => apiElementsSettings.symbols[sym] === true);
desideredSymbols =
defaultRefractSymbolsTree.filter((sym) => lodash.includes(desideredSymbolNames, sym.friendlyName));
// Revalidate any open text documents
documents.all().forEach(validateTextDocument);
});