Giter Site home page Giter Site logo

exercism / codemirror-lang-wren Goto Github PK

View Code? Open in Web Editor NEW
3.0 4.0 4.0 160 KB

Wren language support for the CodeMirror code editor.

License: MIT License

JavaScript 87.49% HTML 1.31% CSS 11.21%
wren codemirror highlight lezer community-contributions-paused

codemirror-lang-wren's Introduction

codemirror-lang-wren NPM Version

This package implements Wren language support for the CodeMirror code editor. Originally derived from the JavaScript grammar and language support.

The project page for CodeMirror has more information, a number of examples and the documentation.

This code is released under an MIT license.

Language Support + Lezer Grammar

This includes both the CodeMirror LanguageSupport and the LRLanguage grammar all bundled into a single small repository with a simple build process.

Maintainers

There is a very rough developer tool in devtool that can be used for testing.

npm run build-devtool

API Reference

wren() โ†’ย LanguageSupport

Wren support. Includes snippet completion.

wrenLanguage: LRLanguage

A language provider based on the Lezer Wren parser provided in this very same package, extended with highlighting and indentation information.

lezerParser: Lezer#Parser

Lezer Wren parser.

snippets: Completion[]

A collection of simple Wren-related snippets.

codemirror-lang-wren's People

Contributors

erikschierboom avatar exercism-bot avatar joshgoebel avatar kytrinyx avatar sleeplessbyte avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

codemirror-lang-wren's Issues

Hook up to official Exercism site

@iHiD Who do we need to assign this to? In the editor on exercism.lol my code is still all the same color so I assume we need to hook this into our CodeMirror setup now?

Fix error importing package

If I try to import the package using:

const { wren } = await import('@exercism/codemirror-lang-wren')

I get the following error:

TS2307: Cannot find module '@exercism/codemirror-lang-wren' or its corresponding type declarations.

Changing the dynamic import to a regular one results in the same error:

import { wren } from '@exercism/codemirror-lang-wren'

Importing a file using import '@exercism/codemirror-lang-wren/dist/index.es' does work.

The node_modules/@exercism/codemirror-lang-wren directory has the following files:

dist/index.cjs
dist/index.es.js
LICENSE
package.json
README.md

Add typings to package

In order for this package to integrate nicely with TypeScript projects, it should provide typings. The typings should look something like this:

declare module '@exercism/codemirror-lang-wren' {
  import { StreamParser } from '@codemirror/stream-parser'
  export const wren: StreamParser<unknown>
}

Cannot find type declarations when imported using `"bundler"` as module resolution

Hey! I am trying to install the latest version (1.0.0) but it looks like it doesn't work when setting moduleResulution to bundler when using TypeScript:

src/components/Editor/languageCompartment.ts:47:37 - error TS2307: Cannot find module '@exercism/codemirror-lang-wren' or its corresponding type declarations.

47       const { wren } = await import("@exercism/codemirror-lang-wren");
                                       ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Any idea how to fix this?

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.