This is an archive of the discontinued LLVM Phabricator instance.

[clangd] Add a toy VS Code integration for development purposes
ClosedPublic

Authored by krasimir on Feb 17 2017, 10:22 AM.

Event Timeline

krasimir created this revision.Feb 17 2017, 10:22 AM
krasimir edited the summary of this revision. (Show Details)Feb 17 2017, 10:26 AM
krasimir added reviewers: klimek, bkramer.
mprobst added inline comments.
clangd/clients/clangd-vscode/src/extension.ts
1

ES6 modules are always in strict mode, you can drop this here.

7

use /** JSDoc comments */ so that you get these comments on hover in the IDE.

11

prefer to always use const for variables that don't get re-assigned.

17

.h?

23

remove the tutorial comments?

28

this comment does not seem to fit the next line

clangd/clients/clangd-vscode/test/extension.test.ts
2

remove the tutorial comments?

clangd/clients/clangd-vscode/tsconfig.json
7

As this runs in a recent Node with pretty complete ES6 support, consider including:

  • ES2015.Core
  • ES2015.Collection
  • ES2015.Generator
  • ES2015.Iterable
  • ES2015.Promise
  • ES2015.Symbol
  • ES2016.Array.Include

These add declarations for a bunch of useful library builtins, e.g. for array iteration, String.repeat, and so on.

10

tsc supports a bunch of strictness options that you should enable. See here for the reference: https://www.typescriptlang.org/docs/handbook/compiler-options.html

Enable:

  • alwaysStrict
  • noEmitOnError
  • noFallthroughCasesInSwitch
  • noImplicitAny
  • noImplicitReturns
  • noImplicitThis

The following are a bit questionable (I prefer to use tslint for them as they break the workflow):

  • noUnusedLocals
  • noUnusedParameters
clangd/clients/clangd-vscode/vsc-extension-quickstart.md
1

drop or update?

krasimir updated this revision to Diff 90164.Mar 1 2017, 5:10 AM
krasimir marked 10 inline comments as done.
  • Address review comments
bkramer accepted this revision.Mar 1 2017, 6:01 AM

lgtm

This revision is now accepted and ready to land.Mar 1 2017, 6:01 AM
mprobst accepted this revision.Mar 1 2017, 6:04 AM
mprobst added inline comments.
clangd/clients/clangd-vscode/test/extension.test.ts
2

nit: use @fileoverview for, well, fileoverview comments :-)

8

// TODO(krasimir): ...

This revision was automatically updated to reflect the committed changes.