@vtsls/language-service
Usage example
import { createTSLanguageService } from "@vtsls/language-service";
const service = createTSLanguageService({
clientCapabilities: {},
});
await service.initialize({
typescript: { tsserver: { log: "verbose" } },
});
const uri = "file:///path/to/file.ts";
const fileContent = "";
service.openTextDocument({
textDocument: {
uri,
languageId: "typescript",
version: 0,
text: fileContent,
},
});
const response = await service.documentSymbol({ textDocument: { uri } })
console.log(response);
service.dispose();
See @vtsls/language-server for more examples.