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

Add Visual Studio Code project config file for JS #3129

Merged
merged 1 commit into from
Mar 24, 2016

Conversation

robertknight
Copy link
Member

In combination with JSDoc annotations, this enables IntelliSense,
project navigation, inline documentation, refactoring and other goodies
using Visual Studio Code and other IDEs that integrate with TypeScript's
Language Service for JavaScript (aka. 'Salsa').

See https://code.visualstudio.com/docs/languages/javascript

The project file can be named either jsconfig.json without 'allowJs'
or tsconfig.json with the 'allowJs' config option enabled. I've opted
for tsconfig.json because that turns up better documentation on the
web and is recognized by more tools.

The project config file lives in h/static/scripts so that Visual Studio
only tries to parse and process .js files under that directory. The
config file does support specifying the set of files to include, but
each file currently has to be listed individually. Glob support is
planned for the future. See
microsoft/TypeScript#1927

In combination with JSDoc annotations, this enables IntelliSense,
project navigation, inline documentation, refactoring and other goodies
using Visual Studio Code and other IDEs that integrate with TypeScript's
Language Service for JavaScript (aka.  'Salsa').

See https://code.visualstudio.com/docs/languages/javascript

The project file can be named either `jsconfig.json` without 'allowJs'
or `tsconfig.json` with the 'allowJs' config option enabled. I've opted
for `tsconfig.json` because that turns up better documentation on the
web and is recognized by more tools.

The project config file lives in h/static/scripts so that Visual Studio
only tries to parse and process .js files under that directory.  The
config file does support specifying the set of files to include, but
each file currently has to be listed individually. Glob support is
planned for the future. See
microsoft/TypeScript#1927
@codecov-io
Copy link

Current coverage is 69.94%

Merging #3129 into master will not affect coverage as of 5ddc429

@@            master   #3129   diff @@
======================================
  Files          110     110       
  Stmts         4368    4368       
  Branches       512     512       
  Methods          0       0       
======================================
  Hit           3055    3055       
  Partial         83      83       
  Missed        1230    1230       

Review entire Coverage Diff as of 5ddc429

Powered by Codecov. Updated on successful CI builds.

@nickstenning
Copy link
Contributor

I'm generally reluctant to merge support for specific editors/environments, as it just clutters up the root of the repository.

Editorconfig seems like a fair concession, as it's generic, but this --- I'm not so sure.

Thoughts?

@nickstenning
Copy link
Contributor

If you're adding it because it shows up in git status, then don't forget you can add your own custom ignores to the repository in .git/info/exclude.

@robertknight
Copy link
Member Author

@nickstenning - I think I the PR/commit title is probably misleading. This is about enabling the use of refactoring, code navigation etc. with IDEs and other tools that can leverage TypeScript's language services. I mentioned VS Code because that's the best tool for said job right now, though Atom also has a pretty capable add-in.

@nickstenning
Copy link
Contributor

Hmmm. Ok. I'm reminded, though, of why I cannot stand the use of JSON for config files. It would be really nice if we could include a comment at the top of this file explaining its purpose...

@nickstenning nickstenning merged commit 5c2f69a into master Mar 24, 2016
@nickstenning nickstenning deleted the vscode-project-file branch March 24, 2016 12:00
@robertknight
Copy link
Member Author

@nickstenning - Ah,you're in luck. tsconfig.json does actually support comments, despite being a JSON file: microsoft/TypeScript#5450

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