ace-linters 0.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/Globals.d.ts +2 -0
- package/README.md +59 -0
- package/build/bundle.ace-linters.js +2 -0
- package/components/description-tooltip.ts +134 -0
- package/css/linters.css +8 -0
- package/index.d.ts +9 -0
- package/index.ts +15 -0
- package/language-provider.ts +167 -0
- package/message-controller.ts +120 -0
- package/message-types.ts +132 -0
- package/package.json +17 -0
- package/services/base-service.ts +118 -0
- package/services/css/css-service.ts +82 -0
- package/services/html/html-service.ts +57 -0
- package/services/json/json-service.ts +102 -0
- package/services/language-service.d.ts +73 -0
- package/services/service-manager.ts +133 -0
- package/services/typescript/lib/lib.index.ts +73 -0
- package/services/typescript/lib/lib.ts +73 -0
- package/services/typescript/lib/typescriptServices-amd.js +164121 -0
- package/services/typescript/lib/typescriptServices.d.ts +7597 -0
- package/services/typescript/lib/typescriptServices.js +164128 -0
- package/services/typescript/lib/typescriptServicesMetadata.ts +5 -0
- package/services/typescript/typescript-service.ts +191 -0
- package/type-converters/common-converters.ts +33 -0
- package/type-converters/converters.d.ts +3 -0
- package/type-converters/typescript-converters.ts +184 -0
- package/type-converters/vscode-converters.ts +150 -0
- package/web.worker.ts +51 -0
- package/webpack.config.js +59 -0
- package/worker-loader.d.ts +7 -0
package/Globals.d.ts
ADDED
package/README.md
ADDED
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
# Ace Linters
|
|
2
|
+
|
|
3
|
+
Ace linters is a library that brings language-aware features to the Ace editor. It includes a number of language services, each of which provides support for a specific language, such as JSON, HTML, CSS, and Typescript.
|
|
4
|
+
|
|
5
|
+
## Features
|
|
6
|
+
|
|
7
|
+
With Ace linters, you can easily add the following language-aware features to your Ace editor:
|
|
8
|
+
- Error checking
|
|
9
|
+
- Code completion
|
|
10
|
+
- Type checking
|
|
11
|
+
- Code formatting
|
|
12
|
+
- Additional information about token on hover
|
|
13
|
+
|
|
14
|
+
## Supported languages
|
|
15
|
+
|
|
16
|
+
Ace linters supports the following languages:
|
|
17
|
+
- JSON, JSON5 (with JsonService)
|
|
18
|
+
- HTML (with HtmlService)
|
|
19
|
+
- CSS, SCSS, LESS (with CssService)
|
|
20
|
+
- Typescript, Javascript, JSX, TSX (with TypescriptService)
|
|
21
|
+
|
|
22
|
+
## Installation
|
|
23
|
+
|
|
24
|
+
To install Ace linters, you can use the following command:
|
|
25
|
+
|
|
26
|
+
```bash
|
|
27
|
+
npm install ace-linters
|
|
28
|
+
|
|
29
|
+
## Usage
|
|
30
|
+
|
|
31
|
+
To use Ace linters, you will first need to include it in your project and create an instance of the Ace editor and an instance of LanguageProvider. Then, LanguageProvider will use the appropriate language service based on the mode being used:
|
|
32
|
+
```javascript
|
|
33
|
+
import * as ace from "ace-code";
|
|
34
|
+
import {Mode as TypescriptMode} from "ace-code/src/mode/typescript";
|
|
35
|
+
import {registerStyles, LanguageProvider, setLanguageGlobalOptions, AceLinters} from "ace-linters";
|
|
36
|
+
import { ScriptTarget, JsxEmit } from "ace-linters/type-converters/typescript-converters";
|
|
37
|
+
|
|
38
|
+
//provides better styles for hover tooltip
|
|
39
|
+
registerStyles();
|
|
40
|
+
// set global options for Typescript Service, if haven't called,
|
|
41
|
+
// would use default instead
|
|
42
|
+
setLanguageGlobalOptions("typescript", {
|
|
43
|
+
compilerOptions: {
|
|
44
|
+
allowJs: true,
|
|
45
|
+
target: ScriptTarget.ESNext,
|
|
46
|
+
jsx: JsxEmit.Preserve
|
|
47
|
+
}
|
|
48
|
+
});
|
|
49
|
+
|
|
50
|
+
let editor = ace.edit("container");
|
|
51
|
+
editor.session.setMode(new TypescriptMode());
|
|
52
|
+
// Create Language Provider (you could pass options as second parameter)
|
|
53
|
+
let provider = new LanguageProvider(editor, {});
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
Once you have created a language provider, you can use the Ace editor as you normally would, and the language-aware features provided by the service will be available.
|
|
57
|
+
|
|
58
|
+
## License
|
|
59
|
+
Ace linters is released under the [MIT License](https://opensource.org/licenses/MIT).
|