Giter Site home page Giter Site logo

vscode-sts's Introduction

Work in progress VSCode extension for a DSL based on TypeScript. See microsoft/vscode#85788.

Goal

Provide all IntelliSense features that VSCode provides for TypeScript, but for custom file extension (e.g. *.sts). This is needed to support "internal" DSLs: custom languages that use a subset of TypeScript.

How does this work

This is a VSCode extension that configures a language (*.sts files) and activates a TS server plugin that enables TypeScript language service for the new file extension. tsconfig.json are virtual: they are generated on the fly based on stsconfig.json by redirecting filesystem calls.

Features

  • Autocomplete and hover tips
  • Providing custom declarations
  • Go to defintion for *.ts and *.sts
  • Auto-import
  • Virtual tsconfig.json: custom settings are read from stsconfig.json

Open problems

To run

npm install
npm run build

code .

# In VSCode press 'F5' (Use fn on Mac), new VSCode instance will open, open ./example directory with it

Developing against local VSCode

# Follow https://github.com/microsoft/vscode/wiki/How-to-Contribute to build local VSCode
# Use `yarn watch` to build VSCode

# enable TSS_LOG (see https://github.com/Microsoft/TypeScript/wiki/Standalone-Server-%28tsserver%29#logging)
export TSS_LOG="-level verbose -file ~/vscode-sts/tss.log"

# inside VSCode directory
./scripts/code.sh --extensionDevelopmentPath=$ABSOLUTE_PATH_TO_VSCODE_STS_DIRECTORY ~/vscode-sts/example

Context

VSCode uses built-in typescript-language-features extension that spawns TS server (TypeScript Language Service). TS server supports plugin system. VSCode extension can provide a plugin to a TS server.

TypeScript is not using LSP, however 2 third-party solutions exists:

Useful resources

Language server plugins

Docs

vscode-sts's People

Stargazers

Valerii Vasin avatar

Watchers

Artem Tyurin avatar James Cloos avatar  avatar

vscode-sts's Issues

Newly created *.sts files do not pick up declarations

index.sts correctly knows about customSTSFunction and v1:
before

Newly created bar.sts with the same content does know about customSTSFunction, but not know about v1:
after

This probably has something to do with the call to reloadProjects after the initialization.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.