Skip to content

Feedback to improve compileOnSave with tsserver. #17630

Open

Description

@angelozerr

I have implemented inside Eclipse compile on save with tsserver by consuming compileOnSaveAffectedFileList and compileOnSaveEmitFile commands. It works great but I think we could again improved it

For compileOnSaveAffectedFileList:

  • compileOnSaveAffectedFileList should throw error when the given file is excluded of tsconfig.json. It will give the capability to display an error dialog when user wishes to compile a ts file which is excluded by tsconfig.json
  • in some case, tsserver compileOnSaveAffectedFileList returns *.d.ts files (see ttps://github.com/ ts.TypeScriptNoContentAvailableException on compile angelozerr/typescript.java#190#issuecomment-317876026) those *.d.ts files must be ignored for compilation.

For compileOnSaveEmitFile:

  • the reponse compileOnSaveEmitFile should return diagnostics errors. I had to call the two tsserver commands syntacticDiagnosticsSync and semantacticDiagnosticsSync after the call of compileOnSaveEmitFile to display errors in the Eclipse "Problem View"
  • the reponse compileOnSaveEmitFile should return the emited files path (js and *.js.map). In Eclipse case it's very helpful because I could refresh the files.

Activity

  1. changed the title [-]Feedback to improve compile on save with tsserver.[/-] [+]Feedback to improve compileOnSave with tsserver.[/+] on Aug 6, 2017
  2. mhegazy commented on Aug 29, 2017

    @mhegazy
    Contributor

    compileOnSaveAffectedFileList should throw error when the given file is excluded of tsconfig.json. It will give the capability to display an error dialog when user wishes to compile a ts file which is excluded by tsconfig.json

    do not you have this already from projectInfo?

    in some case, tsserver compileOnSaveAffectedFileList returns *.d.ts files (see angelozerr/typescript.java#190 (comment)) those *.d.ts files must be ignored for compilation.

    I would say this is a bug.

    the reponse compileOnSaveEmitFile should return diagnostics errors. I had to call the two tsserver commands syntacticDiagnosticsSync and semantacticDiagnosticsSync after the call of compileOnSaveEmitFile to display errors in the Eclipse "Problem View"

    I would disassociate errors from compile-on-save.

    the reponse compileOnSaveEmitFile should return the emited files path (js and *.js.map). In Eclipse case it's very helpful because I could refresh the files.

    seems like a reasonable request. PRs welcomed.

  3. added
    Domain: APIRelates to the public API for TypeScript
    and removed
    Needs More InfoThe issue still hasn't been fully clarified
    on Oct 27, 2017
  4. mhegazy commented on Oct 27, 2017

    @mhegazy
    Contributor

    PRs welcomed for changing compileOnSaveEmitFile to return a list of generated files.

  5. added this to the milestone on Jan 4, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Domain: APIRelates to the public API for TypeScriptHelp WantedYou can do thisSuggestionAn idea for TypeScriptVS Code TrackedThere is a VS Code equivalent to this issue

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions