Async LanguageServiceHost
See original GitHub issueSearch Terms
language
, service
, host
, async
, api
Suggestion
It’d super awesome if Language Service would accept a LanguageServiceHost with async API
Use Cases
Using LanguageService
in environments where readFileSync
is not available like browsers (using browserfs
package or fs provided by WebSockets
)
I’m working on an app like CodeSandbox but a bit more sophisticated.
Examples
class Host implements ts.LanguageServiceHost {
async getScriptSnapshot(filename: string): Promise<ts.IScriptSnapshot> { }
async readFile(filename: string): Promise<string> {}
}
Checklist
My suggestion meets these guidelines:
- This wouldn’t be a breaking change in existing TypeScript/JavaScript code
- This wouldn’t change the runtime behavior of existing JavaScript code
- This could be implemented without emitting different JS based on the types of the expressions
- This isn’t a runtime feature (e.g. library functionality, non-ECMAScript syntax with JavaScript output, etc.)
- This feature would agree with the rest of TypeScript’s Design Goals.
Issue Analytics
- State:
- Created 5 years ago
- Reactions:12
- Comments:7 (4 by maintainers)
Top Results From Across the Web
typescript LanguageService TypeScript Examples
async function measureLanguageService( languageService: LanguageService, args: MeasureLanguageServiceArgs ): Promise<LanguageServiceSingleMeasurement> ...
Read more >How to use the typescript-json-schema.buildGenerator ... - Snyk
To help you get started, we've selected a few typescript-json-schema.buildGenerator examples, based on popular ways it is used in public projects.
Read more >https://rd3space.com/node_modules/typescript/lib/t...
... Protected = 16, Static = 32, Readonly = 64, Abstract = 128, Async = 256, ... interface LanguageServiceHost extends GetEffectiveTypeRootsHost ...
Read more >Documentation - TypeScript 4.7
lib.d.ts Updates · Stricter Spread Checks in JSX · Stricter Checks with Template String Expressions · readFile Method is No Longer Optional on...
Read more >Async/await in TypeScript - LogRocket Blog
Async and await enable developers to write asynchronous code that looks and behaves like synchronous code and is easier to read, write, ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Does anyone of you know a workaround for creating an asynchronous
getSemanticDiagnostics
?@oldrich-svec oooh… thank you! that is very very handy! 👍