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

Do not serialize the AST if the skipAst flag is set #4738

Merged

Conversation

ilia-kebets-sonarsource
Copy link
Contributor

@ilia-kebets-sonarsource ilia-kebets-sonarsource commented Jun 14, 2024

With this change, we skip the AST serialization, not just the sending of the AST in the response.

@ilia-kebets-sonarsource ilia-kebets-sonarsource changed the title Do not serialize if 'skipAst' flag is set Do not serialize the AST if the skipAst flag is set Jun 14, 2024
Comment on lines 95 to 96
const ast = serializeAst(sourceCode, filePath, input.skipAst);
if (ast) {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oups, that was my initial suggestion that led to this imprecision...
Nice catch anyway.
I still think it feels strange to pass this argument. What about:

if (!input.skipAst) {
  const ast = serializeAst(sourceCode, filePath);
  if (ast) {
    result.ast = ast;
  }
}

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Both are not great. I'll add your suggestion.

@quentin-jaquier-sonarsource quentin-jaquier-sonarsource merged commit ad002df into master Jun 14, 2024
16 of 17 checks passed
@quentin-jaquier-sonarsource quentin-jaquier-sonarsource deleted the fix/do-not-serialized-if-skipAst-flag-is-on branch June 14, 2024 13:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants