-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Start on supporting autoimports (#46)
- Loading branch information
Showing
59 changed files
with
3,044 additions
and
4,100 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,6 @@ | ||
node_modules | ||
coverage | ||
src/**.js | ||
scripts/**.js | ||
dist | ||
.DS_Store |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -16,6 +16,7 @@ in CodeMirror. | |
- Hover hints for types | ||
- Autocomplete | ||
- Diagnostics (lints, in CodeMirror's terminology) | ||
- Go-to definition | ||
|
||
## Peer dependencies | ||
|
||
|
@@ -244,6 +245,7 @@ that accept the `worker` instead of `env` as an argument. | |
override: [tsAutocompleteWorker()], | ||
}), | ||
tsHoverWorker(), | ||
tsGotoWorker(), | ||
]; | ||
``` | ||
|
||
|
@@ -294,6 +296,15 @@ in the future. | |
|
||
Comlink is [lightweight](https://bundlephobia.com/package/[email protected]) (4.7kb gzipped). | ||
|
||
## Conceptual notes: LSP | ||
|
||
This module uses TypeScript’s public APIs to power its functionality: | ||
it _doesn't_ use the [Language Server Protocol](https://en.wikipedia.org/wiki/Language_Server_Protocol), which is | ||
a specification developed by Microsoft and intended for functionality like | ||
this. TypeScript itself does not have a first-party LSP implementation | ||
and LSP is usually used across a network. Most good TypeScript language | ||
tooling, like VS Code’s autocompletion, does not use the LSP specification. | ||
|
||
### ❤️ Other great CodeMirror plugins | ||
|
||
- [codemirror-vim](https://github.com/replit/codemirror-vim) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
{ | ||
"$schema": "https://biomejs.dev/schemas/1.9.4/schema.json", | ||
"vcs": { | ||
"enabled": false, | ||
"clientKind": "git", | ||
"useIgnoreFile": false | ||
}, | ||
"files": { | ||
"ignoreUnknown": false, | ||
"ignore": ["demo", "dist", "coverage", "scripts", "test"] | ||
}, | ||
"formatter": { | ||
"enabled": true, | ||
"indentStyle": "tab" | ||
}, | ||
"organizeImports": { | ||
"enabled": true | ||
}, | ||
"linter": { | ||
"enabled": true, | ||
"rules": { | ||
"recommended": true, | ||
"style": { | ||
"noNonNullAssertion": "off" | ||
}, | ||
"suspicious": { | ||
"noConsole": "error" | ||
} | ||
} | ||
}, | ||
"javascript": { | ||
"formatter": { | ||
"quoteStyle": "double" | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,13 +4,15 @@ | |
<meta charset="UTF-8" /> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0" /> | ||
<title>codemirror-ts demo</title> | ||
<meta name='description' content='A set of CodeMirror extensions that give it the powers of TypeScript' /> | ||
<link rel="preconnect" href="https://fonts.googleapis.com" /> | ||
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin /> | ||
<link | ||
href="https://fonts.googleapis.com/css2?family=IBM+Plex+Mono:wght@400;700&display=swap" | ||
rel="stylesheet" | ||
/> | ||
<link href="./demo.css" rel="stylesheet" /> | ||
<link rel="stylesheet" href="https://unpkg.com/[email protected]"> | ||
<link rel="stylesheet" href="demo.css"> | ||
</head> | ||
<body> | ||
<main> | ||
|
@@ -28,16 +30,17 @@ <h2>Currently supported</h2> | |
<li>Autocomplete</li> | ||
<li>Hover</li> | ||
<li>Diagnostics</li> | ||
<li>Go to definition</li> | ||
</ul> | ||
<h2>Demo</h2> | ||
<h2>Demos</h2> | ||
|
||
<h3>TypeScript running on the page</h3> | ||
<div id="app"> | ||
<div id="app" class='border'> | ||
<div id="editor"></div> | ||
</div> | ||
|
||
<h3>TypeScript environment in a web worker</h3> | ||
<div id="app"> | ||
<div id="app" class='border'> | ||
<div id="editor-worker"></div> | ||
</div> | ||
</main> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.