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

refactor: consolidate diagnostics funcs into single file #416

Merged

Commits on Aug 30, 2022

  1. refactor: consolidate diagnostics funcs into single file

    - move `IDiagnostic` and `convertDiagnostic` from `tscache` to `print-diagnostics`, then rename it to `diagnostics.ts`
      - the diagnostic funcs being in `tscache` always felt like a strange place for them
        - especially when `parse-tsconfig` or `print-diagnostics` would import them from `tscache`, which sounded like an unrelated file
    
    - may want to move `diagnostics-format-host` into this file as well, as it is _only_ used in this file
      - leaving as is for now, limiting this change to a smaller one
    agilgur5 committed Aug 30, 2022
    Configuration menu
    Copy the full SHA
    b05b1f2 View commit details
    Browse the repository at this point in the history
  2. test: add unit test for convertDiagnostic

    - this was previously only covered in integration tests
      - since unit tests don't currently touch `index` or `tscache`, and `convertDiagnostic` was previously in `tscache`
        - another reason why consolidating these functions into one file made sense
    agilgur5 committed Aug 30, 2022
    Configuration menu
    Copy the full SHA
    2d3cfe3 View commit details
    Browse the repository at this point in the history
  3. fix(diagnostics): use formatHost.getNewLine() instead of \n

    - since new lines are host OS specific
    
    - this fixes the `convertDiagnostic` test on Windows too, where it was failing
    agilgur5 committed Aug 30, 2022
    Configuration menu
    Copy the full SHA
    7c2fdda View commit details
    Browse the repository at this point in the history