Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions acumate-plugin/src/extension.ts
Original file line number Diff line number Diff line change
Expand Up @@ -236,6 +236,8 @@ function init(context: vscode.ExtensionContext) {
AcuMateContext.HtmlValidator = vscode.languages.createDiagnosticCollection('htmlValidator');

AcuMateContext.repositoryPath = getRepositoryPath();

vscode.commands.executeCommand('typescript.restartTsServer');
}

function getRepositoryPath(): string | undefined {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -145,8 +145,18 @@ export async function createScreenExtension() {
if (uri) {
const document = await vscode.workspace.openTextDocument(uri);
await vscode.window.showTextDocument(document);
if (AcuMateContext.ConfigurationService.clearUsages) {
await vscode.commands.executeCommand(`editor.action.organizeImports`);
if (AcuMateContext.ConfigurationService.clearUsages) {
const handler = vscode.workspace.onDidChangeTextDocument(doc => {
if (doc.document.uri.path === document.uri.path) {
try {
doc.document.save();
} finally {
handler.dispose();
}
}
});
setTimeout(() => handler.dispose(), 5000); // Fallback timeout
await vscode.commands.executeCommand('editor.action.organizeImports');
}
}
}
12 changes: 11 additions & 1 deletion acumate-plugin/src/scaffolding/create-screen/create-screen.ts
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,17 @@ export async function createScreen() {
const document = await vscode.workspace.openTextDocument(uri);
await vscode.window.showTextDocument(document);
if (AcuMateContext.ConfigurationService.clearUsages) {
await vscode.commands.executeCommand(`editor.action.organizeImports`);
const handler = vscode.workspace.onDidChangeTextDocument(doc => {
if (doc.document.uri.path === document.uri.path) {
try {
doc.document.save();
} finally {
handler.dispose();
}
}
});
setTimeout(() => handler.dispose(), 5000); // Fallback timeout
await vscode.commands.executeCommand('editor.action.organizeImports');
}
}
}