All Projects → sveltejs → Language Tools

sveltejs / Language Tools

Licence: mit
The Svelte Language Server, and official extensions which use it

Programming Languages

typescript
32286 projects

Projects that are alternatives of or similar to Language Tools

Vscode R Lsp
R LSP Client for Visual Studio Code
Stars: ✭ 57 (-88.95%)
Mutual labels:  vscode-extension, language-server
Ffi Navigator
Stars: ✭ 122 (-76.36%)
Mutual labels:  vscode-extension, language-server
Vscode Intelephense
PHP intellisense for Visual Studio Code
Stars: ✭ 872 (+68.99%)
Mutual labels:  vscode-extension, language-server
Svelte Language Server
A WIP language server for Svelte
Stars: ✭ 98 (-81.01%)
Mutual labels:  language-server, svelte
Vshaxe
Haxe Support for Visual Studio Code
Stars: ✭ 234 (-54.65%)
Mutual labels:  vscode-extension, language-server
Vscode Swift
An extension for VS Code which provides support for the Swift language.
Stars: ✭ 132 (-74.42%)
Mutual labels:  vscode-extension, language-server
Vscode Java
Java Language Support for Visual Studio Code
Stars: ✭ 1,370 (+165.5%)
Mutual labels:  vscode-extension, language-server
vscode-tenkawa-php
Visual Studio Code extension integrating Tenkawa PHP language server.
Stars: ✭ 28 (-94.57%)
Mutual labels:  language-server, vscode-extension
Svelte Vscode
Svelte language support for VS Code
Stars: ✭ 211 (-59.11%)
Mutual labels:  vscode-extension, svelte
Langserver Swift
A Swift implementation of the open Language Server Protocol.
Stars: ✭ 171 (-66.86%)
Mutual labels:  vscode-extension, language-server
vscode-caddyfile-support
Rich Caddyfile support for Visual Studio Code
Stars: ✭ 30 (-94.19%)
Mutual labels:  language-server, vscode-extension
Vscode Haskell
VS Code extension for Haskell, powered by haskell-language-server
Stars: ✭ 311 (-39.73%)
Mutual labels:  vscode-extension, language-server
Vscode R
R Extension for Visual Studio Code (execution, snippet, lint, R documantation, R Markdown)
Stars: ✭ 445 (-13.76%)
Mutual labels:  vscode-extension
Svelte Devtools
An extension that allows inspection of Svelte component hierarchy and state in the Firefox and Chrome developer tools.
Stars: ✭ 484 (-6.2%)
Mutual labels:  svelte
Vscode Markdownlint
Markdown linting and style checking for Visual Studio Code
Stars: ✭ 444 (-13.95%)
Mutual labels:  vscode-extension
Gistpad
VS Code extension for managing and sharing code snippets, notes and interactive samples using GitHub Gists
Stars: ✭ 443 (-14.15%)
Mutual labels:  vscode-extension
Vscode Rust
Rust for Visual Studio Code
Stars: ✭ 488 (-5.43%)
Mutual labels:  vscode-extension
Ts Graphql Plugin
TypeScript Language Service Plugin for GraphQL developers
Stars: ✭ 479 (-7.17%)
Mutual labels:  language-server
Marp Vscode
Marp for VS Code: Create slide deck written in Marp Markdown on VS Code
Stars: ✭ 442 (-14.34%)
Mutual labels:  vscode-extension
Edamagit
Magit for VSCode
Stars: ✭ 440 (-14.73%)
Mutual labels:  vscode-extension

Cybernetically enhanced web apps: Svelte npm version license

IDE docs and troubleshooting

What is Svelte Language Tools?

Svelte Language Tools contains a library implementing the Language Server Protocol (LSP). LSP powers the VSCode extension, which is also hosted in this repository. Additionally, LSP is capable of powering plugins for numerous other IDEs.

A .svelte file would look something like this:

<script>
    let count = 1;

    // the `$:` means 're-run whenever these values change'
    $: doubled = count * 2;
    $: quadrupled = doubled * 2;

    function handleClick() {
        count += 1;
    }
</script>

<button on:click="{handleClick}">Count: {count}</button>

<p>{count} * 2 = {doubled}</p>
<p>{doubled} * 2 = {quadrupled}</p>

Which is a mix of HTMLx and vanilla JavaScript (but with additional runtime behavior coming from the svelte compiler).

This repo contains the tools which provide editor integrations for Svelte files like this.

Packages

This repo uses yarn workspaces, which TLDR means if you want to run a commands in each project then you can either cd to that directory and run the command, or use yarn workspace [package_name] [command].

For example yarn workspace svelte-language-server test.

svelte-language-server

The language server for Svelte. Built from UnwrittenFun/svelte-language-server and heavily inspired by Vetur to become the official language server for the language.

svelte-check

A command line tool to check your svelte files for type errors, unused css, and more. Built from Vetur's VTI.

svelte-vscode

The official vscode extension for Svelte. Built from UnwrittenFun/svelte-vscode to become the official vscode extension for the language.

svelte2tsx

Converts a .svelte file into a legal TypeScript file. Built from halfnelson/svelte2tsx to provide the auto-complete and import mapping inside the language server.

Want to see how it's transformed? Check out this REPL

Development

Setup

Pull requests are encouraged and always welcome. Pick an issue and help us out!

To get an overview of the internals, read here.

To install and work on these tools locally:

Make sure to uninstall the extension from the marketplace to not have it clash with the local one.

git clone https://github.com/sveltejs/language-tools.git svelte-language-tools
cd svelte-language-tools
yarn install
yarn bootstrap

Do not use npm to install the dependencies, as the specific package versions in yarn.lock are used to build and test Svelte.

To build all of the tools, run:

yarn build

The tools are written in TypeScript, but don't let that put you off — it's basically just JavaScript with type annotations. You'll pick it up in no time. If you're using an editor other than Visual Studio Code you may need to install a plugin in order to get syntax highlighting and code hints etc.

Making Changes

There are two ways to work on this project: either by working against an existing project or entirely through tests.

Running the Dev Language Server Against Your App

To run the developer version of both the language server and the VSCode extension:

  • open the root of this repo in VSCode
  • Go to the debugging panel
  • Make sure "Run VSCode Extension" is selected, and hit run

This launches a new VSCode window and a watcher for your changes. In this dev window you can choose an existing Svelte project to work against. If you don't use pure Javascript and CSS, but languages like Typescript or SCSS, your project will need a Svelte preprocessor setup. When you make changes to the extension or language server you can use the command "Reload Window" in the VSCode command palette to see your changes. When you make changes to svelte2tsx, you first need to run yarn build within its folder.

Running Tests

You might think that as a language server, you'd need to handle a lot of back and forth between APIs, but actually it's mostly high-level JavaScript objects which are passed to the npm module vscode-languageserver.

This means it's easy to write tests for your changes:

yarn test

For tricker issues, you can run the tests with a debugger in VSCode by setting a breakpoint (or adding debugger in the code) and launching the task: "Run tests with debugger".

Supporting Svelte

Svelte is an MIT-licensed open source project with its ongoing development made possible entirely by the support of awesome volunteers. If you'd like to support their efforts, please consider:

Funds donated via Open Collective will be used for compensating expenses related to Svelte's development such as hosting costs. If sufficient donations are received, funds may also be used to support Svelte's development more directly.

License

MIT

Credits

  • UnwrittenFun for creating the foundation which this language server, and the extensions are built on
  • Vue's Vetur language server which heavily inspires this project
  • halfnelson for creating svelte2tsx
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].