
Security News
Risky Biz Podcast: Making Reachability Analysis Work in Real-World Codebases
This episode explores the hard problem of reachability analysis, from static analysis limits to handling dynamic languages and massive dependency trees.
monaco-pyright-lsp
Advanced tools
Make a Pyright language server running on browser and provide language features to Monaco Editor
Make a Pyright python language server running on browser and provide language features to Monaco Editor.
Try it on browser: https://sardinefish.github.io/monaco-pyright-lsp/
We bundle a pyright language server into a Web Worker using webpack with a lot of polyfills to make it running on browser.
The pyright server worker is built with pyright source code version 1.1.386
to access its internal modules.
The filesystem that pyright server required are provided by ZenFS
Thanks Pyright Playground as an example to implement language provider with pyright
for monaco-editor
npm install
npm run build
See /examples/webpack/src/index.ts
for example.
This require a bundle tool (webpack, etc.) to distribute on web.
npm install monaco-pyright-lsp
import * as monaco from "monaco-editor";
import { MonacoPyrightProvider } from "monaco-pyright-lsp";
import largeUserModStubPack from "../../typings/packed_user_mod.zip";
const userTypeStub =
`
def user_func(a: int, b: str) -> float: ...
`;
const exampleCode =
`from user_mod import user_func
print("Hello World!")
def add(a: int, b: float) -> float:
return a + b
x = add(1, 2)
`;
async function init()
{
const pyrightProvider = new MonacoPyrightProvider(undefined, {
typeStubs: {
"user_mod": {
"__init__.pyi": userTypeStub
},
"packed_user_mod": largeUserModStubPack,
},
});
await pyrightProvider.init(monaco,);
const editorInstance = monaco.editor.create(document.querySelector("#editor") as HTMLElement, {
value: exampleCode,
language: "python",
});
await pyrightProvider.setupDiagnostics(editorInstance);
}
init();
FAQs
Make a Pyright language server running on browser and provide language features to Monaco Editor
The npm package monaco-pyright-lsp receives a total of 1,062 weekly downloads. As such, monaco-pyright-lsp popularity was classified as popular.
We found that monaco-pyright-lsp demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
This episode explores the hard problem of reachability analysis, from static analysis limits to handling dynamic languages and massive dependency trees.
Security News
/Research
Malicious Nx npm versions stole secrets and wallet info using AI CLI tools; Socket’s AI scanner detected the supply chain attack and flagged the malware.
Security News
CISA’s 2025 draft SBOM guidance adds new fields like hashes, licenses, and tool metadata to make software inventories more actionable.