Press n or j to go to the next uncovered block, b, p or k for the previous block.
| 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 | 1x 3x 3x 2x 2x 2x 1x | import * as vscode from 'vscode';
import { container } from 'tsyringe';
import { ServiceToken } from '@src/services/tokens';
import { TurtlePrefixDefinitionService } from '@src/languages/turtle/services/turtle-prefix-definition-service';
export const sortPrefixes = {
id: 'mentor.command.sortPrefixes',
handler: async (documentUri: vscode.Uri) => {
const document = vscode.workspace.textDocuments.find(doc => doc.uri.toString() === documentUri.toString());
if (document) {
const service = container.resolve<TurtlePrefixDefinitionService>(ServiceToken.TurtlePrefixDefinitionService);
const edit = await service.sortPrefixes(document);
if (edit.size > 0) {
await vscode.workspace.applyEdit(edit);
}
}
}
}; |