Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Eliminar parámetro innecesario #164

Open
PalumboN opened this issue May 4, 2024 · 0 comments
Open

Eliminar parámetro innecesario #164

PalumboN opened this issue May 4, 2024 · 0 comments
Labels
component: linter Linter / Validator reporter good first issue Good for newcomers refactor Make a refactor in the project

Comments

@PalumboN
Copy link
Contributor

PalumboN commented May 4, 2024

La función validateTextDocument‎ del linter:

export const validateTextDocument =
(connection: Connection, allDocuments: TextDocument[]) =>
(textDocument: TextDocument) =>
async (environment: Environment): Promise<void> => {
await updateDocumentSettings(connection)
const timeMeasurer = new TimeMeasurer()
try {
const problems = validate(environment)
sendDiagnostics(connection, problems, allDocuments)
} catch (error) {
logger.error(`✘ Validate text document error: ${error}`, error)
generateErrorForFile(connection, textDocument)
} finally {
const documentUri = relativeFilePath(textDocument.uri)
timeMeasurer.addTime(`Validating ${documentUri}`)
timeMeasurer.finalReport()
}
}

Espera un textDocument: TextDocument (currificado al final) pero en realidad se revalida todo el environment (siempre hay que revalidar todo, porque cambios en un archivo pueden afectar los errores en otros, y no tenemos un sistema para trackear eso).

Yo lo sacaría, ya que ahora solo se usa para loggear (se podría usar la cantidad de archivos que tiene el Environment en ese momento... 🤔) y queda confusa la firma. Y como está currificada a veces el IDE no se da cuenta que la manqueamos (como ya pasó).

@PalumboN PalumboN mentioned this issue May 4, 2024
7 tasks
@PalumboN PalumboN added good first issue Good for newcomers component: linter Linter / Validator reporter refactor Make a refactor in the project labels May 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component: linter Linter / Validator reporter good first issue Good for newcomers refactor Make a refactor in the project
Projects
None yet
Development

No branches or pull requests

1 participant