You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/). For more information see the [Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/) or contact [opencode@microsoft.com](mailto:opencode@microsoft.com) with any additional questions or comments.
This plugin requires TypeScript 2.4 or later. It can provide intellisense in both JavaScript and TypeScript files within any editor that uses TypeScript to power their language features. This includes [VS Code](https://code.visualstudio.com), [Sublime with the TypeScript plugin](https://github.com/Microsoft/TypeScript-Sublime-Plugin), [Atom with the TypeScript plugin](https://atom.io/packages/atom-typescript), and others.
11
+
12
+
### With VS Code
13
+
To use this plugin with VS Code, first install the plugin and a copy of TypeScript in your workspace:
Then add a `plugins` section to your [`tsconfig.json`](http://www.typescriptlang.org/docs/handbook/tsconfig-json.html) or [`jsconfig.json`](https://code.visualstudio.com/Docs/languages/javascript#_javascript-project-jsconfigjson)
20
+
21
+
```json
22
+
{
23
+
"compilerOptions": {
24
+
"plugins": [
25
+
{
26
+
"name": "typescript-lit-html-plugin"
27
+
}
28
+
]
29
+
}
30
+
}
31
+
```
32
+
33
+
Finally, run the `Select TypeScript version` command in VS Code to switch to use the workspace version of TypeScript for VS Code's JavaScript and TypeScript language support. You can find more information about managing typescript versions [in the VS Code documentation](https://code.visualstudio.com/Docs/languages/typescript#_using-newer-typescript-versions).
34
+
35
+
Also consider installing the [lit-html](https://marketplace.visualstudio.com/items?itemName=bierner.lit-html) extension to get stytax highlighting for lit-html template strings.
36
+
37
+
38
+
### With Sublime
39
+
This plugin works with the [Sublime TypeScript plugin](https://github.com/Microsoft/TypeScript-Sublime-Plugin).
40
+
41
+
First install the plugin and a copy of TypeScript in your workspace:
And configure Sublime to use the workspace version of TypeScript by [setting the `typescript_tsdk`](https://github.com/Microsoft/TypeScript-Sublime-Plugin#note-using-different-versions-of-typescript) setting in Sublime:
Finally add a `plugins` section to your [`tsconfig.json`](http://www.typescriptlang.org/docs/handbook/tsconfig-json.html) or [`jsconfig.json`](https://code.visualstudio.com/Docs/languages/javascript#_javascript-project-jsconfigjson) and restart Sublime.
56
+
57
+
```json
58
+
{
59
+
"compilerOptions": {
60
+
"plugins": [
61
+
{
62
+
"name": "typescript-lit-html-plugin"
63
+
}
64
+
]
65
+
}
66
+
}
67
+
```
68
+
69
+
### With Atom
70
+
This plugin works with the [Atom TypeScript plugin](https://atom.io/packages/atom-typescript).
71
+
72
+
First install the plugin and a copy of TypeScript in your workspace:
Then add a `plugins` section to your [`tsconfig.json`](http://www.typescriptlang.org/docs/handbook/tsconfig-json.html) or [`jsconfig.json`](https://code.visualstudio.com/Docs/languages/javascript#_javascript-project-jsconfigjson) and restart Atom.
79
+
80
+
```json
81
+
{
82
+
"compilerOptions": {
83
+
"plugins": [
84
+
{
85
+
"name": "typescript-lit-html-plugin"
86
+
}
87
+
]
88
+
}
89
+
}
90
+
```
91
+
92
+
To get sytnax highlighting for lit-html strings in Atom, consider installing the [language-babel](https://atom.io/packages/language-babel) extension.
93
+
94
+
95
+
## Configuration
96
+
97
+
### Tags
98
+
This plugin adds html IntelliSense to any template literal [tagged](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Template_literals) with `html`:
99
+
100
+
```js
101
+
import {html} from'lit-html'
102
+
103
+
html`
104
+
<div></div>
105
+
`
106
+
```
107
+
108
+
You can enable IntelliSense for other tag names by configuring `"tags"`:
109
+
110
+
```json
111
+
{
112
+
"compilerOptions": {
113
+
"plugins": [
114
+
{
115
+
"name": "typescript-lit-html-plugin",
116
+
"tags": [
117
+
"html",
118
+
"template"
119
+
]
120
+
}
121
+
]
122
+
}
123
+
}
124
+
```
125
+
126
+
## Contributing
127
+
128
+
To build the typescript-lit-html-plugin, you'll need [Git](https://git-scm.com/downloads) and [Node.js](https://nodejs.org/).
129
+
130
+
First, [fork](https://help.github.com/articles/fork-a-repo/) the typescript-lit-html-plugin repo and clone your fork:
The plugin is written in [TypeScript](http://www.typescriptlang.org). The source code is in the `src/` directory with the compiled JavaScript output to the `lib/` directory. Kick off a build using the `compile` script:
144
+
145
+
```bash
146
+
npm run compile
147
+
```
148
+
149
+
And then run the end to end tests with the `e2e` script:
150
+
151
+
```bash
152
+
(cd e2e && npm install)
153
+
npm run e2e
154
+
```
155
+
156
+
You can submit bug fixes and features through [pull requests](https://help.github.com/articles/about-pull-requests/). To get started, first checkout a new feature branch on your local repo:
157
+
158
+
```bash
159
+
git checkout -b my-awesome-new-feature-branch
160
+
```
161
+
162
+
Make the desired code changes, commit them, and then push the changes up to your forked repository:
163
+
164
+
```bash
165
+
git push origin my-awesome-new-feature-branch
166
+
```
167
+
168
+
Then [submit a pull request](https://help.github.com/articles/creating-a-pull-request/
169
+
) against the Microsoft typescript-lit-html-plugin repository.
170
+
171
+
Please also see our [Code of Conduct](CODE_OF_CONDUCT.md).
172
+
173
+
174
+
## Credits
175
+
176
+
Code originally forked from: https://github.com/Quramy/ts-graphql-plugin
0 commit comments