Skip to content

Commit

Permalink
change code block lang to svelte
Browse files Browse the repository at this point in the history
only where it's appropriate
  • Loading branch information
ignatiusmb committed Apr 16, 2021
1 parent 294ed32 commit be3687b
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ Svelte Language Tools contains a library implementing the Language Server Protoc

A `.svelte` file would look something like this:

```html
```svelte
<script>
let count = 1;
Expand Down
4 changes: 2 additions & 2 deletions docs/internal/overview.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ Our `language-server` can roughly be split into [four areas](/packages/language-
The last area, TS/JS, is where most of the work is done. Svelte is a mix of JavaScript/TypeScript inside `script` and more of it within Svelte's template syntax. To get a holistic view of the file, we need to account for both.
This is also the reason why preprocessors such as `svelte-preprocess` cannot do type checking because it produces wrong diagnostics. To preprocess the script content, it only gets the content from the script. Think of this situation:

```html
```svelte
<script lang="ts">
let a: number = 1;
</script>
Expand Down Expand Up @@ -64,7 +64,7 @@ This example shows how our `language-server` uses `svelte2tsx`:

1. Svelte file comes in

```html
```svelte
<script>
export let world = 'name';
</script>
Expand Down
2 changes: 1 addition & 1 deletion docs/preprocessors/in-general.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ module.exports = {

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.

```html
```svelte
<div>
<h1>Hello, world!</h1>
</div>
Expand Down
2 changes: 1 addition & 1 deletion docs/preprocessors/scss-less.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ module.exports = {

To gain syntax highlighing for your SCSS code and to make us understand the language you are using, add a `type` or `lang` attribute to your style tags like so:

```html
```svelte
<!-- Add type="text/scss" -->
<style type="text/scss">
header {
Expand Down
6 changes: 3 additions & 3 deletions docs/preprocessors/typescript.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ Adding it to an existing project? [The official blog post explains how to do it]

To tell us to treat your script tags as typescript, add a `type` or `lang` attribute to your script tags like so:

```html
```svelte
<!-- Add type="text/typescript" -->
<script type="text/typescript">
export let name: string;
Expand Down Expand Up @@ -48,7 +48,7 @@ When you are using TypeScript, you can type which events your component has in t

The first and possibly most often used way is to type the `createEventDispatcher` invocation like this:

```html
```svelte
<script lang="ts">
import { createEventDispatcher } from 'svelte';
Expand Down Expand Up @@ -78,7 +78,7 @@ Make sure to follow the [setup instructions](/packages/svelte-vscode#setup)

The following code may throw an error like `Variable 'show' implicitly has type 'any' in some locations where its type cannot be determined.`, if you have stricter type settings:

```html
```svelte
<script lang="typescript">
export let data: { someKey: string | null };
Expand Down

0 comments on commit be3687b

Please sign in to comment.