Skip to content

Commit 8fb1171

Browse files
committed
Add 'packages/svelte-vscode/' from commit '0ee13ea02c9f6a3e4127db81ad5fa02eeddf3cbf'
git-subtree-dir: packages/svelte-vscode git-subtree-mainline: 96a98b6 git-subtree-split: 0ee13ea
2 parents 96a98b6 + 0ee13ea commit 8fb1171

17 files changed

+2707
-0
lines changed

Diff for: packages/svelte-vscode/.gitignore

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
/dist
2+
/node_modules

Diff for: packages/svelte-vscode/.prettierrc

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
"useTabs": false,
3+
"printWidth": 100,
4+
"tabWidth": 4,
5+
"semi": true,
6+
"trailingComma": "all",
7+
"singleQuote": true
8+
}

Diff for: packages/svelte-vscode/.vscode/launch.json

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
{
2+
"version": "0.2.0",
3+
// List of configurations. Add new configurations or edit existing ones.
4+
"configurations": [
5+
{
6+
"name": "Launch Client",
7+
"type": "extensionHost",
8+
"request": "launch",
9+
"runtimeExecutable": "${execPath}",
10+
"args": ["--extensionDevelopmentPath=${workspaceRoot}"],
11+
"stopOnEntry": false,
12+
"sourceMaps": true,
13+
"outFiles": ["${workspaceRoot}/dist/**/*.js"]
14+
}
15+
]
16+
}

Diff for: packages/svelte-vscode/.vscodeignore

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
**/tsconfig.json
2+
src
3+
.vscode

Diff for: packages/svelte-vscode/CHANGELOG.md

+123
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,123 @@
1+
# Changelog
2+
3+
## 0.9.3
4+
5+
- Update to [svelte-language-server](https://github.com/UnwrittenFun/svelte-language-server/releases/v0.10.3) 0.10.3
6+
- Don't trigger autocompletion in css when typing {
7+
- Debounce diagnostics requests to improve diagnostic performance
8+
- Document settings and preprocessor configuration
9+
10+
## 0.9.2
11+
12+
- Update to [svelte-language-server](https://github.com/UnwrittenFun/svelte-language-server/releases/v0.10.2) 0.10.2
13+
- Update to [prettier-plugin-svelte](https://github.com/UnwrittenFun/prettier-plugin-svelte/releases/tag/v0.7.0) 0.7.0
14+
- Added strict html mode with option `svelte-strict-mode`
15+
- Added support for await block shorthand
16+
- Now handles multiple script and style tags
17+
- HTML entities (e.g. &) will be kept as is in svelte > 3.4.3
18+
- New option `svelteBracketNewLine` to add a new line before closing `>` when wrapping attributes
19+
- Added support for all known svelte:\* elements
20+
- Added support for local modifier on transitions
21+
- Fixed if inside of each else blocks erroneously being converted to and else if block
22+
- Added sort order option to change order of script/style/markup available as `svelte-sort-order`
23+
- Fix some whitespace issues with inline tags
24+
25+
## 0.9.1
26+
27+
- Update to [svelte-language-server](https://github.com/UnwrittenFun/svelte-language-server/releases/v0.10.1) 0.10.1
28+
- Update to [prettier-plugin-svelte](https://github.com/UnwrittenFun/prettier-plugin-svelte/releases/tag/v0.5.1) 0.5.1
29+
- Better attribute wrapping
30+
- No longer opens output panel on error
31+
32+
## 0.9.0
33+
34+
- Update to [svelte-language-server](https://github.com/UnwrittenFun/svelte-language-server/tree/v0.10.0) 0.10.0
35+
- Adds suggestion diagnostics for typescript/javascript
36+
- Add code actions to typescript/javascript
37+
- Add go to definition support for typescript/javascript
38+
- Fix emmet completions showing up inconsistently
39+
- Update to [prettier-plugin-svelte](https://github.com/UnwrittenFun/prettier-plugin-svelte/releases/tag/v0.5.0) 0.5.0
40+
- Adds better whitespace support
41+
- Adds support for all utf8 characters in styles and scripts
42+
- Support event modifiers
43+
- Support let and class bindings
44+
- .html files are no longer associated to this plugin by default
45+
46+
## 0.8.0
47+
48+
- Update to [svelte-language-server](https://github.com/UnwrittenFun/svelte-language-server/tree/v0.8.0) 0.8.0
49+
- No longer applies semantic validation to JavaScript blocks (only syntactic).
50+
- Add autocompletions to js/ts
51+
- Formatting is now provided by [prettier-plugin-svelte](https://github.com/UnwrittenFun/prettier-plugin-svelte)
52+
which gives much improved support for svelte specific syntax and fixes a number of issues with the previous setup
53+
54+
## 0.7.1
55+
56+
- Update to [svelte-language-server](https://github.com/UnwrittenFun/svelte-language-server/tree/v0.7.1) 0.7.1
57+
- Fix for breaking changes in svelte v3
58+
59+
## 0.7.0
60+
61+
- Support for Svelte v3
62+
- Update to [svelte-language-server](https://github.com/UnwrittenFun/svelte-language-server/tree/v0.7.0) 0.7.0
63+
- Svelte is now loaded from your project when possible
64+
- Updates to various packages
65+
66+
## 0.6.1
67+
68+
- Update to [svelte-language-server](https://github.com/UnwrittenFun/svelte-language-server/tree/v0.6.1) 0.6.1
69+
- Includes some minor bug fixes
70+
71+
## 0.6.0
72+
73+
- Update to [svelte-language-server](https://github.com/UnwrittenFun/svelte-language-server/tree/v0.6.0) 0.6.0
74+
- Add symbols in the outline panel for css, html, and typescript
75+
- Add html formatting
76+
- Add color information and color picker to css
77+
- Add support for lang attribute on style and script tags
78+
79+
## 0.5.0
80+
81+
- Update to [svelte-language-server](https://github.com/UnwrittenFun/svelte-language-server/tree/v0.5.0) 0.5.0
82+
- Add config options for all features provided by the language server
83+
84+
## 0.4.2
85+
86+
- Add command to restart language server (useful if it errors or is using stale data)
87+
- Access it using `Cmd-Shift-P` or `Ctrl-Shift-P` and typing "restart language server"
88+
89+
## 0.4.1
90+
91+
- Update to [svelte-language-server](https://github.com/UnwrittenFun/svelte-language-server/tree/v0.4.2) 0.4.2
92+
- Has better support for typescript in workspaces
93+
- Now actually bundles the lib.d.ts files from typescript.. 🤦
94+
95+
## 0.4.0
96+
97+
- Update to [svelte-language-server](https://github.com/UnwrittenFun/svelte-language-server/tree/v0.4.0) 0.4.0
98+
- Includes fix to prevent attempting to load svelte config from package.json
99+
- Switching language type (.e.g from `type=text/javascript` to `type=text/typescript`) no longer crashes the server
100+
101+
## 0.3.2
102+
103+
- Allow space after key in each block ([#12](https://github.com/UnwrittenFun/svelte-vscode/issues/12))
104+
105+
## 0.3.1
106+
107+
- Register .svelte extension ([#8](https://github.com/UnwrittenFun/svelte-vscode/pull/8))
108+
- Fix highlighting error when using object destructuring in each blocks ([#11](https://github.com/UnwrittenFun/svelte-vscode/issues/11))
109+
- Use correct comments in typescript and scss blocks
110+
111+
## 0.3.0
112+
113+
- Add html tag autoclosing ([#4](https://github.com/UnwrittenFun/svelte-vscode/pull/4))
114+
- Fix incorrect comments being used for css and html ([#3](https://github.com/UnwrittenFun/svelte-vscode/issues/3))
115+
116+
## 0.2.0
117+
118+
- Update to [svelte-language-server](https://github.com/UnwrittenFun/svelte-language-server/tree/v0.2.0) 0.2.0
119+
- Emmet abbreviations support for HTML and CSS ([#2](https://github.com/UnwrittenFun/svelte-vscode/issues/2))
120+
121+
## 0.1.0
122+
123+
- Initial release

Diff for: packages/svelte-vscode/LICENSE

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2018 James Birtles
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

Diff for: packages/svelte-vscode/README.md

+164
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,164 @@
1+
# Svelte for VS Code
2+
3+
Provides syntax highlighting and rich intellisense for Svelte components in VS Code, utilising the [svelte language server](https://github.com/UnwrittenFun/svelte-language-server).
4+
5+
## Features
6+
7+
- Svelte
8+
- Diagnostic messages for warnings and errors
9+
- Support for svelte preprocessors that provide source maps
10+
- Svelte specific formatting (via [prettier-plugin-svelte](https://github.com/UnwrittenFun/prettier-plugin-svelte))
11+
- HTML
12+
- Hover info
13+
- Autocompletions
14+
- [Emmet](https://emmet.io/)
15+
- Symbols in Outline panel
16+
- CSS / SCSS / LESS
17+
- Diagnostic messages for syntax and lint errors
18+
- Hover info
19+
- Autocompletions
20+
- Formatting (via [prettier](https://github.com/prettier/prettier))
21+
- [Emmet](https://emmet.io/)
22+
- Color highlighting and color picker
23+
- Symbols in Outline panel
24+
- TypeScript / JavaScript
25+
- Diagnostics messages for syntax errors, semantic errors, and suggestions
26+
- Hover info
27+
- Formatting (via [prettier](https://github.com/prettier/prettier))
28+
- Symbols in Outline panel
29+
- Autocompletions
30+
- Go to definition
31+
- Code Actions
32+
33+
### Using with preprocessors
34+
35+
#### Language specific setup
36+
37+
- [SCSS](docs/preprocessors/scss.md)
38+
- [TypeScript](docs/preprocessors/typescript.md)
39+
40+
#### Generic setup
41+
42+
If a svelte file contains some language other than `html`, `css` or `javascript`, `svelte-vscode` needs to know how to [preprocess](https://svelte.dev/docs#svelte_preprocess) it. This can be achieved by creating a `svelte.config.js` file at the root of your project which exports a svelte options object (similar to `svelte-loader` and `rollup-plugin-svelte`).
43+
44+
```js
45+
// svelte.config.js
46+
const preprocess = require('my-example-svelte-preprocessor');
47+
48+
module.exports = {
49+
preprocess: [preprocess()],
50+
// ...other svelte options
51+
};
52+
```
53+
54+
It's also necessary to add a `type="text/language-name"` or `lang="language-name"` to your `style` and `script` tags, which defines how that code should be interpreted by the extension.
55+
56+
```html
57+
<div>
58+
<h1>Hello, world!</h1>
59+
</div>
60+
61+
<style type="text/scss">
62+
div {
63+
h1 {
64+
color: red;
65+
}
66+
}
67+
</style>
68+
```
69+
70+
### Settings
71+
72+
##### `svelte.language-server.runtime`
73+
74+
Path to the node executable you would like to use to run the language server.
75+
This is useful when you depend on native modules such as node-sass as without
76+
this they will run in the context of vscode, meaning v8 version mismatch is likely.
77+
78+
##### `svelte.plugin.typescript.enable`
79+
80+
Enable the TypeScript plugin. _Default_: `true`
81+
82+
##### `svelte.plugin.typescript.diagnostics`
83+
84+
Enable diagnostic messages for TypeScript. _Default_: `true`
85+
86+
##### `svelte.plugin.typescript.hover`
87+
88+
Enable hover info for TypeScript. _Default_: `true`
89+
90+
##### `svelte.plugin.typescript.documentSymbols`
91+
92+
Enable document symbols for TypeScript. _Default_: `true`
93+
94+
##### `svelte.plugin.typescript.completions`
95+
96+
Enable completions for TypeScript. _Default_: `true`
97+
98+
##### `svelte.plugin.typescript.definitions`
99+
100+
Enable go to definition for TypeScript. _Default_: `true`
101+
102+
##### `svelte.plugin.typescript.codeActions`
103+
104+
Enable code actions for TypeScript. _Default_: `true`
105+
106+
##### `svelte.plugin.css.enable`
107+
108+
Enable the CSS plugin. _Default_: `true`
109+
110+
##### `svelte.plugin.css.diagnostics`
111+
112+
Enable diagnostic messages for CSS. _Default_: `true`
113+
114+
##### `svelte.plugin.css.hover`
115+
116+
Enable hover info for CSS. _Default_: `true`
117+
118+
##### `svelte.plugin.css.completions`
119+
120+
Enable auto completions for CSS. _Default_: `true`
121+
122+
##### `svelte.plugin.css.documentColors`
123+
124+
Enable document colors for CSS. _Default_: `true`
125+
126+
##### `svelte.plugin.css.colorPresentations`
127+
128+
Enable color picker for CSS. _Default_: `true`
129+
130+
##### `svelte.plugin.css.documentSymbols`
131+
132+
Enable document symbols for CSS. _Default_: `true`
133+
134+
##### `svelte.plugin.html.enable`
135+
136+
Enable the HTML plugin. _Default_: `true`
137+
138+
##### `svelte.plugin.html.hover`
139+
140+
Enable hover info for HTML. _Default_: `true`
141+
142+
##### `svelte.plugin.html.completions`
143+
144+
Enable auto completions for HTML. _Default_: `true`
145+
146+
##### `svelte.plugin.html.tagComplete`
147+
148+
Enable HTML tag auto closing. _Default_: `true`
149+
150+
##### `svelte.plugin.html.documentSymbols`
151+
152+
Enable document symbols for HTML. _Default_: `true`
153+
154+
##### `svelte.plugin.svelte.enable`
155+
156+
Enable the Svelte plugin. _Default_: `true`
157+
158+
##### `svelte.plugin.svelte.diagnostics.enable`
159+
160+
Enable diagnostic messages for Svelte. _Default_: `true`
161+
162+
##### `svelte.plugin.svelte.format.enable`
163+
164+
Enable formatting for Svelte (includes css & js). _Default_: `true`

0 commit comments

Comments
 (0)