Skip to content

Relay Compiler outputted file links - bad format for VSCode #4571

@alex-statsig

Description

@alex-statsig

When running the relay compiler with errors, theres a few problems with the outputted erroring filepaths. They are not critical or "wrong", but cause inconvenience when attempting to open the problematic line (especially in vscode). Here's an example output:

[ERROR] Compilation failed.
[ERROR] Unable to run relay compiler. Error details: 
Failed to build:
 - Validation errors:
 - The type `Company` has no field `metric`. Did you mean `metrics`?:client/components/console/metrics_catalog/MetricPageInsightsCard.tsx:495:501
  1. Theres no space between "Did you mean?" and the file link. This causes vs-code to think the filepath starts with the "?", so cmd-clicking the file in terminal fails
  2. Theres a colon before the path; I'm not sure why this is here (to indicate its relative to the root?), but again it is included in the path opened by VSCode upon cmd-clicking, causing it to fail to find any files
  3. The numbers after the path appear to be character indices within the file, whereas vscode expects the format <path>:<linenumber>:<character_index_within_line>. I'm not sure how standard this format is, but it would be very convenient within vscode at least to adopt this format.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions